8i logo 8i.co.za

Embed Buythis Product by WordPress Shortcode Plugin on Your Website for Buythis Store Affiliate Program

Source: https://buythis.co.za/shortcode

Buythis.co.za Price Embed Shortcode

Download from WordPress Repository.

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:

SourceEndpoint URLExample value parameterdatahttps://data.buythis.co.za/product/[ sku ].jsondata.name.fulldisplayhttps://data.buythis.co.za/product/[ sku ]/display.jsondisplay.contentpricehttps://data.buythis.co.za/product/[ sku ]/price.jsonprice.2024-01-01.saleotherDynamic fixed dataother.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 formatGenerated table column headerscartSelect, Image, SKU (and Name), Price, QuantitylistImage, Description, Price (incl), Buytable1Image, 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:

Shortcuts

The following shortcut value options are available:

ShortcutSubstituted path (value parameter)buy<a href="https://buythis.co.za/(display.slug)#(other.affiliate),cart,1,(other.variant)contentdisplay.contentlinkhttps://buythis.co.za/(display.slug)#(other.affiliate)link_name(data.name.full|data.name.simple)namedata.name.full|data.name.simplepriceR (data.price.sale|data.price.regular)regular_priceR (data.price.regular|data.price.sale)sale_priceR (data.price.sale|data.price.regular)

Syntax

In order of precedence:

Frequently Asked Questions

Is this plugin free to use?

Yes, this plugin is free to use. The source code is also available for you to examine what the plugin does and how it works.