
Amazon Product in a Post Plugin 2.0.2
Quickly add formatted Amazon Products to post/page by using just the Amazon ASIN (ISBN-10). Great for monetizing your posts.
NOTE: Version 2.0.2 only updates the Amazon API call that goes into effect on 02/06/2012.* If you do not update the plugin will cease to function after 02/06/2012.
Due to changes in Amazon’s API call limitations on 10/15/2010, this plugin now requires you have an AWS Public and Private Key of your own to use. You can get a new Key by signing up at http://aws-portal.amazon.com/gp/aws/developer/account/index.html.
Amazon Product In a Post Plugin is used to to quickly add a formatted Amazon Product/Item to a post or page by using just the Amazon product ASIN (also known as the ISBN-10).
What can you use it for?
With this plugin you can:
- Add any Amazon product or item to an existing Post (or Page).
- Monetize your blog posts with custom Amazon Product and add your own Reviews, descriptions or any other thing you would normally want to add to a post – and still have the Amazon product there.
- Easily add only the items that are right for your site.
- Add the product to the TOP of the post content, the BOTTOM of the post content, or make the post content become part of the product layout (see screenshots for examples)
- You can add as many products as you want to any existing page/post content using a Shortcode – see Installation or FAQ page for details.
If you have an Amazon Affiliate account and you don’t think the available Amazon widgets are that great or are what you need, then this plugin might be for you.
How it Works:
The plugin uses the newly revised (and re-named) Amazon Product Advertising API. Older plugins that use Old API calls will no longer work as of 8/2009 because Amazon implemented a new security call procedure that makes many of them obsolete.
To use the plugin, you must have an Amazon Affiliate Account. You can sign up here if you do not have one – it is free and pretty easy to do. Once you have an account, install the plugin, then enter your Amazon Associate ID in the plugin options page. You are now ready to start adding products to your post!
PLEASE NOTE: If you DO NOT add your own custom Associate ID, you WILL NOT get credit for any purchases made from your product posts – so don’t set up products on a live site unless you enter that first – or you may lose out on some referral $$. You have been warned!
Shortcode Example:
|
|
Shortcode Multiple Titles Example:
i.e., using [AMAZONPRODUCT=B003L77G6A,B000W91RUG,B001FB4VXU]
|
|
We Also Recommend:
|
|
|
|
Installation
After you install the plugin, you need to set up your Amazon Affiliate/Associate ID in the Options panel located in the AMAZON PIP menu under AMAZON PIP OPTIONS.
An AWS Public and Private/Secret KEY are HIGHLY RECOMMENDED.
If you use the one that is built into the plugin by default, you WILL experience crazy behavior in your product pages. This is due to the changes Amazon made the AWS key usage on 10/15/2010. There is a limit to the number of API calls in an hour based on the User – so if you use mine, it will eventually reach the limit and your products will NOT display until it resets. Please be aware of this before contacting me about problems, because it will be the first question I ask.
No additional adjustments are needed unless you want to configure your own CSS styles. Styles can be adjusted or removed in the Options Panel as well.
WARNING: If you do not add your Amazon Affiliate ID, you will NOT get credit for purchases made using this Plugin.
Usage
Adding products is a simple process. There are several ways to add them:
To Add a product to an existing page/post:
- Go into the full edit mode for the post (Post/Edit then select the post).
- Under the Content editor, there will be a box called Amazon Product In a Post Settings. Maximize it if it is not already fully visible. If you still do not see it, make sure it is selected under “Screen Options”.
- There are 3 sections to fill out, Active, Location and ASIN (See below for adding via Shortcode).
- If Active is checked, the product will be live if the post is published.
- For the Location, pick the spot you want the product to show.
- Then enter the ASIN in the ASIN field.
- Save or Publish the post.
To Add a New Product Post, you have 3 options:
- You can add a new page/post the regular way (Post / Add New / fill out the items /Publish), and them add the product as outlined above.
- You can use the Quick Add Product Feature (called Amazon PIP in the Amazon PIP menu). This is the fastest method for adding a quick product with minimum text. This Method will create a New Post in the selected categories.
- You can add a Product via Shortcode to an existing Page/Post.
To Add a product via Shortcode:
- In the Content editor, add
[AMAZONPRODUCT=XXXXXXXXXX]where XXXXXXXXXX is the Amazon ASIN/ISBN10 number (you can get this from the Amazon site when looking up products). - Update the Page/Post.
You can add as many products this way as you like. Keep in mind that there is a call made to the Amazon API for each product added, so adding too many products could cause a noticeable increase in page loading time. - Some settings in the individual page/post options will affect the shortcodes – currently, you can use the ‘ ‘ or ‘‘ options.
- The individual ‘Product is Active’ option has no effect on products added using the Shortcode. To turn off a Shortcode product, remove the shortcode from the page/post content.
Global Settings
- Amazon Affiliate ID:
Your Amazon Affiliate ID. Remember to add this – if you don’t, you will NOT get credit for any sales. - Amazon Public Key:
Your Amazon Public Key. If you do not have one, you will need to sign up for one. You can do so here. - Amazon Private Key:
Your Amazon Private Key. Check out this page for more information on Public and Secret Keys. - Your Amazon Locale/Region:
The Locale to use for Amazon API Calls (ca, com, co.uk, de, fr, co.jp, it, cn, es). Default is ‘com’ for US. - Language:
Language to use for Text and Button (currently only English, French, Italian and Spanish – default is English). - Not Available Error Message:
The message to display if the item is not available for some reason, i.e., your locale or no longer available. - Amazon Hidden Price Message:
For Some products, Amazon will hide the List price of a product. When hidden, this plugin cannot show a price for the product. This message will display in the List Price area when that occurs. - Hook plugin into Excerpt?:
If you want to have the product displayed when the the_excerpt() function is called, select this box. Disable this function if your theme uses short excerpts on pages, such as the home page. You can override this on each individual page/post. - Hook plugin into Content?:
If you want to have the product displayed when the the_content() function is called, select this box. NOTE: This is the standard call – if you disable both Excerpt and Content, the only way you can add products to a page/post is to add the shortcode ([AMAZONPRODUCT=XXXXXX]where XXXXXX is the ASIN or ISBN 10). You can override this on each individual page/post. - Quick Fix – Hide Warnings?:
IMPORTANT MESSAGE: if you check this box, the plugin will execute the code, ini_set(“display_errors”, 0); to force stop WARNING messages. This can be helpful if your server php configuration has error reporting on and you are getting warning messages. This WILL override any setting you have in your php.ini or php config files. It is not recommended you turn this on unless you need it. - Uninstall when deactivated?:
CAREFUL WITH THIS!! If you check this box, ALL settings and database items will be removed when you deactivate the plugin - Remove ALL traces when uninstalled?:
AGAIN, BE CAREFUL WITH THIS!! If you check this box AND the above box, ALL Amazon shortcodes will be removed from posts and pages and all meta data associated with this plugin will be cleaned up and cleared out when you deactivate this plugin. As a safety precaution, both boxes must be checked or data will not be removed. You should also backup your database before using this method, as it does modify post content. - Open Product Link in New Window?:
If you want to have the product displayed in a new window, check this box. Default is no. - Show on Single Page Only?:
If you want to have the product displayed only when the page/post is singular, check this box. Default is no. - API get method:
If you are seeing BLANK products it may be because your server does not support the php file_get_contents() function. If that is the case, try CURL option to see if it resolves the problem. Default is File Get Contents method. - Use My Custom Styles?:
If you want to use your own styles, check this box and enter the styles in the Product Styles box. - Product Styles:
This allows you to change the look and layout of your product. You need to know some basic CSS in order to do this, but it is quite simple to completely customize your product.The box contains the DEFAULT layout styles. To modify them, simply check the box next to ‘Use My Custom Styles?’ box, then modify the default styles as you see fit. You can also add your own if needed.Note: sometimes a theme may control the layout of a specific element, like a horizontal bar, and this can throw off the default layout. If your theme does this, you can add an new style to override the theme style for just the specific element you need. For example: if your theme uses ‘border:10px;’ for all images in your content and you want the product image to have no border, you can modify this by adding the following to your styles:
div.amazon-image-wrapper img{
border: medium none !important;
}
adding the ‘!important’ indicator forces the browser to use this style instead of your themes default style.
Frequently Asked Questions
See the Installation Page for details on setting up the Products. A more detailed FAQ will come as questions arise.
MY PRODUCTS DO NOT DISPLAY! What is wrong?
It could be several things. The FIRST thing to check is the AMAZON Public and Private/Secret Keys in the options page. If they are blank, you need to sign up for your own from amazon. You can sign up here http://aws-portal.amazon.com/gp/aws/developer/account/index.html to get your own. Without it, your products will be subject to the limits of the built in API Keys – which are limited to the number of calls per hour. Once that limit is reached, no more products will be displayed until it resets. Amazon changed this on 10/15/2010, so if it worked before and is not working now, that should be your first course of action.
Another common cause, is the method of the api call. By default, it is set to use “file_get_contents”, but since some servers do not allow this method you may need to use the older CURL method. Change this in the options page and then check to see if the problem is resolved.
My Products only display a blank image and a “()” for the title – what is wrong?
See the above question and answer – the cause and fix are the same.
Can I uninstall everything if I don’t want to use the plugin anymore?
Yes. With version 2.0 forward, if you want to remove EVERY TRACE of the plugin, you can (There is also a less permanent removal if you you think you may want it back in the future).
The full removal can be initiated by checking “Uninstall when deactivated” AND “Remove ALL traces when uninstalled” in the options page – then deactivate the plugin as usual. This will remove ALL traces of the plugin… that means: the database, options, post meta values, and shortcodes in posts and pages.
The partial removal can be initiated by checking only the “Uninstall when deactivated” option, then save and deactivate the plugin as usual. This will remove the database (which is only cached products) and the basic options. All meta and shortcodes will remain.
How do I add a product?
To Add a New Product Post, you have 3 options:
- You can add a new post the regular way (Post / Add New / fill out the items /Publish), and them add the product as outlined above
- You can use the Quick Add Product Feature (called Amazon PIP in the Amazon PIP menu). This is the fastest method for adding a quick product with minimum text. This Method will create a New Post in the selected categories.
- You can add a Product via Shortcode to an existing Page/Post.
How do I use the Shortcode?
To Add a product Via Shortcode, go to the Content editor for an existing page/post (or create a new post/page), add [AMAZONPRODUCT=XXXXXXXXXX] where XXXXXXXXXX is the Amazon ASIN/ISBN10 number. Then update or save the Page/Post. You can add as many products this way as you like. Just keep in mind that there is a call made to the Amazon API for each product added, so adding too many products could cause a noticeable increase in page loading time.
Can I add the shortcode to the Sidebar Widgets?
Yes, but you will need to modify your functions.php file to do it at this point (an update will be added to a future version to allow this natively).
Add this to your functions.php file for your theme (that way it will not be overwritten when the plugin is updated)
if(function_exists('aws_prodinpost_filter_content')){add_filter('widget_text', 'aws_prodinpost_filter_content', 10);}
This checks to make sure the plugin is installed and if so, adds the filter to the widget text.
Keep in mind you may need to style the products to work in your sidebar theme.
My Products are coming up blank – what do I do?
Most likely the reason is your server does not support external URL call using the file_get_contents() function. If you don’t have access to your sites php.ini file to change the settings (most people don’t), then on the options pages for the plugin, change the API get method to “CURL” and save the settings. This will fix the problem in most cases.
I Want to Change the Look of the Products – can you do that for me?
I would love to say yes, but we cannot make custom changes for everyone that asks – there are just not enough hours in the day – if you REALLY want us to do it for you, contact us – and for a small fee, we will give you whatever look/style you want. Keep in mind that your theme has a lot to do with the way your products look.
You can tweak the look yourself if you have experience with CSS styles. The options page have a style for each element displayed in the product, so you can tweak it however you like. If you screw it up – just reset it back to the default and start over.
My product shows up fine, but there is no price – what’s wrong?
Some products on Amazon.com are provided my external vendors. If a vendor want to hide the price from others until a certain price is reached, they have that ability. When that occurs, Amazon will NOT send the price in the API call – so no price will be displayed. You can edit the custom message that is displayed in the options panel if you wish.
Great Plugin! How do I donate to the cause?
Excellent question! The plugin is provided free to the public – you can use it however you like – where ever you like – you can even change it however you like. Should you decide that the plugin has been a great help and want to donate to our plugin development fund, you may do so here.
Changelog
2.0.2
- Updated Amazon API Call to the latest version. REQUIRED by Amazon.
2.0
- Added Database for caching api calls (10/20/2010)
- Added Options for Private and Public Keys in the options panel. (10/22/2010)
- Added Options for Complete Removal and Partial Removal of Plugin on Deactivate. (10/24/2010)
- Added new error checks to comply with API changes.
- Added new Display checks to not display anything on error (except an HTML Comment in the code) (10/24/2010)
- Fixed option naming convention to resolve a few issues with previous versions (10/24/2010)
- Fixed some code to resolve headers sent issues. (10/23/2010)
- Modified Style calls to fix issues with earlier versions upgrading to newer version (10/23/2010)
- Updated FAQs (10/24/2010)
1.9.1
- Fix to WordPress Core location assumption. Caused Problem when WP core was located outside root. (1/3/2010)
- Added German Language. (special thanks to Henri Sequeira for translations). (1/3/2010)
1.9
- fix to not defined function error. (12/28/2009)
1.8
- Added Fix for users without encoding functions in PHP4 to be able to use. This may have caused some problems with users on 1.7. (12/21/2009)
- Added Options for Language selection. (12/21/2009)
- Added French Language and buttons (special thanks to Henri Sequeira for translations). (12/21/2009)
- Added Lightbox type effect for “View Larger Image” function.(12/22/2009)
- Modified Style Call to use a more WP friendly method to not rely on a “guess” as to where the core WP files are located. (12/22/2009)
- Fixed Open in new window functionality – was not working 100% of the time. (12/22/2009)
1.7
- Add Curl option for users that cant use file_get_contents() for some reason or another. (12/1/2009)
- Added Show on Single Page Only option to Options Page.(11/30/2009)
- Added a way to change encoding display of prices from API if funny characters are showing.(12/1/2009)
1.6
- Added Options to let admin choose if they want to “Hook” into the_excerpt and the_content hooks in Main Options with override on each post/page.(10/3/2009)
- Added Open in a New Window Option (for Amazon button) in Main Options with override on each page/post.(10/3/2009)
- Added “Show Only on Single Page” option to individual post/page options.(10/4/2009)
- Added Shortcode functionality to allow addition of unlimited products in the post/page content.(10/4/2009)
- Added “Quick Fix – Hide Warnings” option in Main Options. Adds ini_set(“display_errors”, 0) to code to help some admins hide any Warnings if their PHP settings are set to show them.(10/3/2009)
- Fixed Array Merge Warning when item is not an array.(10/3/2009)
- Fixed “This Items not available in your locale” message as to when it actually displays and spelling.(10/3/2009)
- Added Options to let admin add their own Error Messages for Item Not available and Amazon Hidden Price notification.(10/3/2009)
- Updated Default CSS styles to include in Stock and Out of Stock classes and made adjustments to other improper styles. (10/3/2009)
1.5
- Remove hook to the_excerpt because it could cause problems in themes that only want to show text. (9/17/2009)
1.4
- Added method to restore default CSS if needed – by deleting all CSS in options panel and saving – default CSS will re-appear in box. (9/16/2009)
1.3
- Added new feature to be able to adjust or add your own styles. (9/16/2009)
1.2
- Fix to image call procedure to help with “no image available” issue. (9/15/2009)
1.1
- Minor Fixes/Spelling Error corrections & code cleanup to prep for WordPress hosting of Plugin. (9/14/2009)
1.0
- Plugin Release (9/12/2009)





