[WordPress] 外掛分享: Buythis Shortcode

WordPress 外掛 Buythis Shortcode 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Buythis Shortcode」是 2021-12-25 上架。
  • 目前有 20 個安裝啟用數。
  • 上一次更新是 2025-04-08,距離現在已有 26 天。
  • 外掛最低要求 WordPress 5.2 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.2 以上。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

fulfillmentglobal |

外掛標籤

buythis |

內容簡介

Buythis.co.za 是一個專門銷售機械的網上商店。

第三方服務說明

此外掛提供一個簡碼以介面 WordPress 與 Buythis.co.za。

此外掛依賴於第三方服務 Buythis.co.za,以便讓此外掛運作。

使用第三方服務是為了從 Buythis.co.za 商店取得 JSON 產品數據。

在此過程中不會收集任何個人數據。

如此外掛的原始碼所示,此外掛僅使用直接和明確由使用者提供的資訊,例如 sku、value 及 affiliate 簡碼參數。

此外掛不會使用其他任何形式的數據,除了使用者提供給外掛簡碼的參數之外。

目前僅通過 HTTP 提交給第三方服務的數據是 sku 參數。

第三方服務連結如下:

https://buythis.co.za
https://data.buythis.co.za
資料定義

第三方服務的使用條款和隱私政策:

https://buythis.co.za/terms
https://buythis.co.za/privacy

使用方法

要使用 Buythis 簡碼外掛:

[buythis sku="sku" value="path" affiliate="affiliate_id"]

提供的 affiliate_id 用於透過此外掛的 [buythis] 簡碼在其 WordPress 網站上為特定聯盟產生收益。

可以在 Buythis 簡碼設置頁面上配置全站的預設聯盟 ID,如果未提供,則會使用此 ID 作為 affiliate_id 屬性的回退值。這樣可以輕鬆更改網站的聯盟 ID,避免在每次簡碼使用中重複使用 affiliate_id。

根據 value 參數中指定的路徑,將進行一個或多個 API 調用到以下端點 (來源),其中 [sku] 為提供的 sku 參數:

來源
端點 URL
範例 value 參數

數據
https://data.buythis.co.za/product/[sku].json
data.name.full

显示
https://data.buythis.co.za/product/[sku]/display.json
display.content

价格
https://data.buythis.co.za/product/[sku]/price.json
price.2022-01-01.sale

其他
動態固定數據
other.affiliate

來源的 API 響應被 JSON 解碼,並從 JSON 響應中提取由 value 參數指定的路徑。

因此,要從來源的 API 響應中提取自定義 JSON 數據,請在 value 參數中使用自定義路徑來指定(描述)來源 API 和要從中提取的 JSON 數據,如上例中每個範例 value 參數所示。

快捷方式

可用的快捷方式 value 選項如下:

|

原文外掛簡介

Buythis.co.za is an online store that specializes in machinery sales.
Website
Visit the plugin website for online documentation.
Third party service description
This plugin provides a shortcode to interface between WordPress and Buythis.co.za.
This plugin relies on Buythis.co.za as a third party service, in order for the plugin to work.
The reason for using the third party service, is to access JSON product data from the Buythis.co.za store.
No personal data is collected during the process.
As can be seen in the plugin’s source code, this plugin only uses information that is directly and knowingly provided by the user themselves, i.e. the sku, variant, value, search, format and affiliate shortcode parameters.
No other data of any kind, whatsoever, is used by this plugin, other than the parameters provided by the user to the plugin shortcode.
The only data currently submitted to the third party service via HTTP is the sku parameter, or the search and format parameters, depending on which of those parameters are explicitly provided to the shortcode.
Links to the third party service:
https://buythis.co.za
https://data.buythis.co.za
Data definition
AWS S3 is used to serve cached data when one of the above primary third party service data sources are not available.
Data received by the plugin via HTTP, is cached in the site’s local WordPress database, and deleted again when the plugin is uninstalled.
Third party services’ terms of use and privacy policies:
https://buythis.co.za/terms
https://buythis.co.za/privacy
Usage
To use the Buythis Shortcode plugin:
[buythis sku="sku" variant="variant" value="path" affiliate="affiliate_id"]

or
[buythis sku="sku" variant="variant" value="path" affiliate="affiliate_id"][/buythis]

The provided affiliate_id is used to generate revenue for a given affiliate, by using this plugin’s [buythis] shortcode on their WordPress site.
A site-wide default Affiliate ID can be configured on the Buythis Shortcode settings page, that will be used as a fallback value for the affiliate parameter, should one not be provided. This makes it easy to change the affiliate ID for a site, and prevents the need to duplicate and maintain the affiliate parameter in each usage of the shortcode.
Depending on the path specified in the value parameter, one or more API calls will be made to the following endpoints (sources), where [sku] is the provided sku parameter:

Source
Endpoint URL
Example value parameter
data
https://data.buythis.co.za/product/[sku].json
data.name.full
display
https://data.buythis.co.za/product/[sku]/display.json
display.content
price
https://data.buythis.co.za/product/[sku]/price.json
price.2024-01-01.sale
other
Dynamic fixed data
other.affiliate

The API response from a source is JSON-decoded, and the path specified by the value parameter is extracted from the JSON response.
Thus, to extract custom JSON data from a source’s API response, use a custom path in the value parameter to specify (describe) the source API and the JSON data to extract from it, as shown in each example value parameter above.
Product listing usage
[buythis search="RDWorks_Upgrade" format="cart"]

[buythis search="sku1, sku2, sku3" format="list"]

[buythis search="sku1|sku2.variant sku3" format="table1"]

An HTML-formatted table of products will be generated, as per the specified format parameter, and any product whose SKU matches either RDWorks_Upgrade, sku1, sku2, sku2.variant, or sku3, will be displayed in the generated table.
Generated listing table format definitions:

Table format
Generated table column headers
cart
Select, Image, SKU (and Name), Price, Quantity
list
Image, Description, Price (incl), Buy
table1
Image, SKU, Description, Price (VAT Incl.), Buy

Usage with WordPress Ajax
To render [buythis sku="sku" variant="variant" value="price" search="search" format="format" affiliate="affiliate_id"][/buythis] dynamically using jQuery:

> jQuery.post(
> ‘/wp-admin/admin-ajax.php’,
> {
> action: ‘buythis_shortcode_ajax’,
> _ajax_nonce: ”,
> sku: ‘sku’,
> variant: ‘variant’,
> value: ‘price’,
> search: ‘search’,
> format: ‘format’,
> affiliate: ‘affiliate_id’
> },
> data => data && jQuery( ‘#buythis_plugin_content’ ).html( data )
> );
>
Shortcuts
The following shortcut value options are available:

| Shortcut | Substituted path (value parameter) |
|—————–|———————————————————————————————————-|
| buy | (data.name.full|data.name.simple) |
| name | data.name.full|data.name.simple |
| price | R (data.price.sale|data.price.regular) |
| regular_price | R (data.price.regular|data.price.sale) |
| sale_price | R (data.price.sale|data.price.regular) |
Syntax
In order of precedence:

() (round braces) is used to treat a path as a format string, by only evaluating sub-paths in the format string that are contained within round braces, and leaving text in the rest of the format string that are outside round braces, intact. Nested braces, i.e. braces inside braces, are not supported, i.e. a sub-path cannot contain a format string. Round braces can contain shortcuts as sub-paths.
| (OR) is to coalesce the first non-null result of a sub-path out of a set of path expressions. A sub-path can be a shortcut, but cannot contain round braces.
. (period) is the JSON separator in a path.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Buythis Shortcode」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


5.2 | trunk |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon