Amazon Products Feed FAQ
[an error occurred while processing this directive]
[an error occurred while processing this directive]
This script is so configurable it can get very confusing; just remember that these are all options. You can just insert your affiliate code, plop this script on your server, and it will run. If you decide to configure it; take it slowly, change one thing at a time, and study the examples. If all else fails check out the Support Forum.
How do I alter the results of the script?
How do I customize the HTML output of the script?
How do I use options in the templates to further customize the HTML output?
How do I change the language?
How do I limit the number of results?
How do I display more results?
How do I display a specific category of bestsellers?
What options are available for searching?
What other options are there?
What about international versions?
Where is the best place to get support and/or discuss your scripts?
How do I alter the results of the script?
How do I customize the HTML output of the script?
Template files. Simple text files containing the HTML and variables you want my script to use to match your site's look and feel. these are used in sets, so $templates_number = 1 specifies the first page template, the first products template, the first item template, etc. And you can use as many sets as you would like so that 1 script can display different items in different ways. Please study the example template files for the proper use of the variables.
@page_templates = ("page.template", "/you/can/even/supply/full/path/to_another.template");
@page_templates should point to a file (or files) that contains the HTML to display the final page. At a minimum this file must contain %%products_html%% as it contains all of the products using the HTML from the products.template
The available variables for use on a page template are listed here.
Example page.template here.
@products_templates = ("products.template", "../or/a/relative/path/to_another_product.template");
@products_templates should point to a file (or files) that contains the HTML you want applied to each product.
The available variables for use on a products template are listed here.
Example products.template here.
@item_templates = ("item.template", "item_2.template");
@item_templates should point to a file (or files) that contains the HTML to display an individual item. This is the big one; there are lots of things you can display about an item.
The available variables for use on an item template are listed here.
Example item.template here.
@larger_image_templates = ("image.template", "image.template");
@larger_image_templates should point to a file (or files) that contains the HTML to display an the large image from Amazon.
The available variables for use in the larger_image template are listed here.
Example larger_image.template here.
Additional Templates:
@sellersearch_templates = ("sellersearch_1.template"); - variables - sample
@sellerprofile_templates = ("sellerprofile_1.template"); - variables - sample
@thirdparty_products_templates = ("thirdpartyproducts_1.template"); - variables - sample
@browse_menu_templates = ("browse_menu_1.template"); - variables - sample
@nav_menu_templates = ("nav_menu_1.template"); - variables - sample
@blended_templates = ("blended_1.template"); - variables - sample
@shopping_cart_templates = ("shopping_cart_1.template"); - variables - sample
@customer_reviews_templates = ("reviews_1.template"); - exactly like item.template
You specify which set of templates to use in the URL with templates. You can even specify one set of templates to display the page and with link_templates another set to be used with any link that is clicked on that page.
To demonstrate look at this page No Options Here; then look at my gaming page half way down the right column Options Used Here and you'll see the bestselling games from Amazon. These are produced with the same script. On the gaming page I just called the script with SSI like this:
<!--#include virtual="/cgi-bin/amazon_products_feed.cgi?mode=videogames&node=471280&templates=4&link_templates=6" -->
How do I use options in the templates to further customize the HTML output?
The options and the HTML they effect are enclosed in a special comment tag.
<!--apf &option1=value&option2=value! HTML here !-->
Notice the exclamation points, they separate the different parts of the command. <!--apf tells the script that options will follow. All options must be proceeded by an & to separate them and the last option is indicated by following it with an !. Anything following that ! through !--> is considered the HTML you want to control. If the option doesn't contain HTML, like for including a text file, the exclamation points still need to be there.
- apf_include - include a text file or nav_menu. As seen in this sample page template and in this example.
For a Text File this is like a Server Side Include (SSI). If you have HTML that you use on many pages (like the menu links at the bottom of all of my pages) you can use this option to include that file in the template.
For a nav_menu it is used with %%nav_menu%% to display a dynamic navigational menu.
The three following options were primarily created to build TABLE rows. As seen in the sample_products.template.
- apf_start - product to start using the HTML at
This is optional if it is not specified the HTML starts with the first product.
- apf_end - last product to use HTML at
You can use the word last to specify the last product. And this option will always add the HTML to the end product, which is necessary to close off any open <TR>s.
- apf_repeat - how often to repeat the HTML
If 1 use with every product, 2 every other product, 3 every third, etc. Viewing the sample_products.template is the best way to understand the use of this.
These options are demonstrated with this Web Services search. Note the site links at the bottom are from an included file and there are now TABLE rows!
How do I change the language?
Languages work like the templates. Simple text files of all the variables that contain the text the script displays that does not come from Amazon. If you wish to create your own language file please use the sample English file as a starting point and be sure and send me a copy so we can share it with others. I would like to provide as many different languages as possible.
@language_templates = ("apf_missing.language", "apf_dutch.language");
@language_templates should point to a file (or files) that contains the language you wish to display. If blank or non-existent will use embedded English.
Language files:
- English - example file
- German - default locale=de file. put this in the same directory as the script and it will be used by default when locale=de
You specify which language to use in the URL with language.
To display multiple languages in HTML there is a special charset (character set) called Unicode. This is the format that Amazon sends their results in and so it is what my script uses. To use accented characters in the language files you must use Unicode entities. Entities are just &#(a number);. I wrote a script to display the characters and show the entity for each so you can use them in your language file - Unicode Generator.
How do I display more results?
Amazon usually only returns 10 products per page. But you can add variables to your page.template that will display links to more results.
%%see_next%% will display a link to the next page of products
%%see_prev%% will display a link to the previous page
%%see_total%% will display the total number of pages
%%see_index%% will display a "Google" type index of pages
How do I display a specific category of bestsellers?
node - this is the category number that you wish to display the bestsellers of.
You can find these id numbers at Amazon's Browse-based Bestsellers Links. On that page you see a list of modes, be sure you set the appropriate mode in the URL when you use node.
Let's say I want to display the bestselling books on Birdwatching. I first decide my mode, Books, so mode=books. Now I click on Books, Outdoors & Nature, and my final category Birdwatching. After you have clicked on the final category look in the URL of the page you are on and find the "node". In this case I see that node=16386, use this number for node. To display the bestselling books on Birdwatching I would use the URL
/cgi-bin/amazon_products_feed.cgi?mode=books&node=16386.
The node numbers that the script already knows and uses for browsing are listed here.
What options are available for searching?
Different searches are specified using the search_type option in the URL and the variables page lists the many different types of searches. All of the searches are displayed on one page using the AllSearches search_type. If you would like to place a search box on any other page of your site just pull up the AllSearches page and view the source to copy the HTML for the search you want.
What other options are there?
If you really want to know everything you can do with the script read the Amazon Products Feed Variables page.
What about international versions?
Amazon.com, Amazon.co.uk, and Amazon.de are currently supported. You can select which location to use in the URL by using &locale=us, &locale=uk, or &locale=de. I plan to support CA when a feed is available and maybe other sites if the language barrier can be overcome.
Where is the best place to get support and/or discuss your scripts?
You can discuss my scripts at MrRat's Scripts Support Forum
You can subscribe to our Scripts Announce list to be notified when changes are made to my scripts.
The latest version of this script can always be found at MrRat.com
[an error occurred while processing this directive]