Showing Amazon Products On Pages and Posts (shortcodes)

WordPress uses special tags within pages and posts known as shortcodes (a word within square brackets[]) to provide custom content provided by plugins. We use the shortcode [mp-amz] to insert real time Amazon product content into posts and pages. Here are the details on what our mpamz shortcode can do.

A Simple Test

The fastest way to test the plugin and get some real-time Amazon content on your pages is to set the default parameters via the Admin panel. Put in your license key, secret key, and AWS key then go create a new WordPress page such as "MP Amazon". In the content of the page simply put in the [mp-amz] shortcode as shown in the following screenshot. Don't worry about keywords or other parameters yet, the plugin will default to the keyword "WordPress" and the "All" search index.

Adding a test page with a simple short code.

When you go to view page you will see a list of Amazon products that have the keyword "WordPress" (our built-in default) associated with them. Each product will be listed with a product image, a description, and a price. If you click on the price you will be brought to the Amazon details page. If you click on the word "+zoom" under the image it will show a closeup of the image in a lightbox floating frame.

Setting Search Terms (keywords parameter)

You can now customize your search by specifying the "keywords" parameter. Change the shortcode from [mp-amz] to [mp-amz keywords="php"]. Now you will see all the Amazon products that have the keyword "php" associated with them.

Setting Search Categories (searchindex parameter)

You can further customize your search by specifying the "searchindex" parameter to determine which subset of products you want to return from Amazon. The list of available values for search index can be found on the admin panel under the Amazon Settings / Default Search Index pulldown. Some example search index settings are "Books" or "Software".

SearchIndex values are case sensitive. Books is not the same as books or BOOKS. You must enter terms exactly as the appear on the pulldown. We know, that is a pain. We didn't make that rule, Amazon did.

Screen Shots

edit_page_simple_shortcode.png - Adding a test page with a simple short code. (26.8 kB) Lance Cleveland, 03/11/2011 08:50 pm