Using a Custom Template
If you wish more flexibilty in defining the appearance of the widget, you can use your own template. To use your own template, you create the
template as a text file that you save on your page like a web page's HTML file. Use the URL of the file in the "Template" parameter of the
widget's code and the widget will read the file and use it as a template for the widget.
Create the template using normal HTML tags plus a few special tags that the widget represents. Here's an example template to get you started:
The widget uses Amazon's "Add-To-Cart" form.
The form requires certain parameters to be passed to it for each item to be added to the cart. The template above shows how this is done by the widget.
The widget reads the template and returns the text in the template with the special tags replaced by information about the products in the bundle.
The special tags are:
$BEGIN$ / $END$ - Since one or more products may be included in the bundle, the special $BEGIN$ and $END$ tags are used to begin and end the
section of the template that is repeated once for each product. The template must contain one, and only one, $BEGIN$ tag and one $END$ tag
following it. All the other special tags may be used only between these two tags.
$COUNT$ - The $COUNT$ tag is replaced by a number, 1 for the first product, 2 for the second, etc. It is used to provide the unique
identofier required to add products to Amazon's cart. Use it in the ASIN and OfferlistingId hidden fields that are required by the "Add-To-Cart"
form.
$MOD$ - The $MOD$ tag is replaced by 0 or 1 - alternating with each product. It may be used to select a style for alternating rows when listing products.
$ASIN$ - The $ASIN$ tag is replaced by the ASIN of the current product. Use it as shown in the example template to tell Amazon what
product to add to the cart.
$OFFER$ - The $OFFER$ tag is replaced by the "Offer ID" of the current product. Products at Amazon.com are often sold by more than one merchant.
To ensure that the price displayed by the widget matches the price of the item in the cart, the widget specifies the offer ID. Use the $OFFER$ tag as shown in the example template to tell Amazon what
offer for the product to add to the cart. The Widget usually lists the offer made by Amazon.com itself.
$SMALL$ / $MEDIUM$ / $LARGE$ - The $SMALL$, $MEDIUM$, and $LARGE$ tags replaced by URLs of small, medium, and large images of the products.
$URL$ - The $URL$ tag is replaced by the URL of the product's page at Amazon.com.
$PRICE$ - The $PRICE$ tag is replaced by the price of the product.
A2SDeveloper.com caches templates so it doesn't have to access your site as often to get the template. If you're testing a new template, add
"&NoCache=Yes" to the end of the "http://www.a2sdeveloper.com/oblio.php..." URL to force A2SDeveloper.com to read the template even if it has a
cached copy. Remove the "NoCache" parameter as soon as you've finished testing the template.
If you wish, your template can be the HTML code for a complete web page. Just edit your page to insert the special tags where you wish the "Product Bundle" widget to be displayed. Then use the URL of the widget directly in links instead of the original page's URL.