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
- 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
- Install the plugin as normal through your WordPress dashboard
- In your WordPress dashboard go to Settings > Amazon Price and enter your Amazonaccess keys
- 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.
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