WP Amazon Price

The WP Amazon price plugin displays the current price of an Amazon item in your blog posts or pages.

All you do is enter a shortcode in your post or theme template and the plugin does the rest.

You can choose to refresh the price every time the page is loaded or you can tell the plugin to remember the price for a set period.

*Note – the current version only supports the US version of Amazon.





Installation

  1. Sign up to Amazon Web Services to obtain your Access Key ID and Secret Access Key. Instructions on finding these are here: http://s3.amazonaws.com/mturk/tools/pages/aws-access-identifiers/aws-identifier.html
  2. Install the plugin as normal through your WordPress dashboard
  3. In your WordPress dashboard go to Settings > Amazon Price and enter your Amazonaccess keys
  4. Change the cache duration as desired. The amount of time selected will dictate how often the price is refreshed. It is recommended that this be left on ‘No Cache’ unless bandwidth use becomes an issue for larger sites.

Adding an Amazon price to posts or widgets

Enter the relevant shortcode, either in your post or in a text widget for your sidebar if desired, and replace ASIN in the example below with the actual ASIN of the item. The ASIN for any Amazon item can be found in the URL or under the ‘Product Details’ heading in the item description. It is recommended that you copy the ASIN from the URL to avoid picking up any special characters.

Here is the ASIN in a product URL

 

And here it is in the description

There are 2 shortcodes that you can use to display prices:

[aprice asin='ASIN']

This shows the current price for the item.

[alistprice asin='ASIN']

This shows the list price for the item, before any discounts.

The shortcode can have any normal formatting applied, and the price will inherit these styles when it is displayed. So you can make your price part of your affiliate link, enclose it in <STRONG> tags, or color it green.

Adding an Amazon price to your theme files

If you are manually editing your theme files to place Amazon items anywhere outside of the loop, use the following code to add a price, replacing ASIN with the items actual ASIN:

<?php echo do_shortcode("[alistprice asin='ASIN']"); ?>

This shows the list price for the item, before any discounts.

<?php echo do_shortcode("[aprice asin='ASIN']"); ?>

This shows the current price for the item.

Examples

This is how you add the short code to a post or widget

 

And this is how the published post will look