Amazon Product in a Post Plugin

banner-772x250

Amazon Product in a Post Plugin 3.6.0

Quickly add formatted Amazon Products to post/page by using just the Amazon ASIN. Great for monetizing your posts.

NOTE: Version 3.5.1 was the first stable release since 2.0.2. It updates the plugin to comply with new Amazon Terms of Use and adds many new features, such as new shortcodes and more product fields.

Amazon’s Product Advertising Terms of Service require you have an AWS Access Key ID (or Public Key) and Secret Access Key (or Private Key) of your own to use.

You can get a new Key by signing up at Amazon. See the FAQs for a link to the API signup for your locale. We cannot add your keys for you – you must add them yourself, as Amazon wants to be sure that your Secret Access Key is same and is not shared with anyone. If you feel it might be known by others, delete your keys at Amazon and get new ones for the plugin.

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 Amazon Product Advertising API. To use the plugin, you must have an Amazon Affiliate Account. You can sign up at amazon if you do not have one – it is free and not too difficult to do. Once you have an account, install the plugin, then enter your Amazon Associate ID and Access Keys 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 $$.

Basic Shortcode Example:

i.e., using

[AMAZONPRODUCTS asin="B008NEMPTO"]

Abraham Lincoln: Vampire Hunter (Blu-ray 3D / Blu-ray / DVD / Digital Copy)


List Price: $14.97 USD
New From: $10.88 USD In Stock
Used from: $4.42 USD In Stock

Shortcode Multiple Titles Example:

i.e., using

[AMAZONPRODUCTS asin="B003L77G6A,B000W91RUG,B001FB4VXU"]

The Big Bang Theory: Season 4


List Price: $24.98 USD
New From: $8.23 USD In Stock
Used from: $3.73 USD In Stock

The Big Bang Theory: Season 1


List Price: $24.98 USD
New From: $13.26 USD In Stock
Used from: $0.97 USD In Stock

The Big Bang Theory: Season 2


List Price: $14.78 USD
New From: $5.70 USD In Stock
Used from: $1.80 USD In Stock

Shortcode Multiple Titles Example 2:

i.e., using

[AMAZONPRODUCTS asin="B003L77G6A"]

and

[AMAZONPRODUCTS asin="B000W91RUG,B001FB4VXU"]

The Big Bang Theory: Seasons 1-4


List Price: $79.95 USD
New From: $59.99 USD In Stock
Used from: $31.50 USD In Stock

We Also Recommend:

The Big Bang Theory: Season 1


List Price: $24.98 USD
New From: $13.26 USD In Stock
Used from: $0.97 USD In Stock

The Big Bang Theory: Season 2


List Price: $14.78 USD
New From: $5.70 USD In Stock
Used from: $1.80 USD In Stock

Amazon Elements Shortcode Example:

i.e., using

[amazon-elements asin="B00B769XB8" fields="image,title,desc,ListPrice,new-price,imagesets,large-image-link" labels="title::3D - Hansel & Gretel: Witch Hunters,desc::Description:,new-price::New From:,ListPrice::Suggested Price:,large-image-link::See Larger Art,features::Features:]
Description: After getting a taste for blood as children, Hansel (Jeremy Renner) and Gretel (Gemma Arterton) have become the ultimate vigilantes, hell-bent on retribution. Now, unbeknownst to them, Hansel and Gretel have become the hunted, and must face an evil far greater than witches…their past.
Suggested Price: $14.65 USD
Additional Images:




Shortcode Grid Layout Example:

i.e., using

[amazon-elements asin="B005LAII4E" fields="lg-image,title,desc,imagesets,new-price,button,large-image-link" msg_instock="" target="_blank" labels="title::G.I. Joe: Retaliation, description::Description:"]

and

[amazon-elements asin="B00BUADSMQ,B00C5W3SBE,B00B769XB8,B00BUC4VS4" fields="image,title,new-price,button" msg_instock="" target="_blank" labels="title::Good Day to Die Hard,title::Oz: Great & Powerful,title::Hansel & Gretel,title::Snitch" container="div"]

and

[amazon-elements asin="B008JFUP0I,B00B52FDXQ,B00CL0J99K,B00CTSDDVO" fields="image,title,new-price,button" msg_instock="" target="_blank" labels="title::The Fast & The Furious 6,title::Spartacus: War of the Damned s3,title::Iron Man 3
2 Disc Set,title::Star Trek: Into the Darkness" container="div"]
In this sequel, the G.I. Joes are not only fighting their mortal enemy Cobra; they are forced to contend with threats from within the government that jeopardize their very existence.
Additional Images:






 

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 Amazon Access Key ID and Secret Access Key is REQUIRED. Please be aware of this first and set them up 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:

  1. 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.
  2. 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.
  3. You can add a Product via Shortcode to an existing Page/Post.

To Add a product via Shortcode:

  • In the Content editor, add
    [AMAZONPRODUCTS asin="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 (
    [AMAZONPRODUCTS asin="XXXXXXXXXXX"]

    where XXXXXXXXXXX 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

3.5.2
  • Fix to issue with Add New Amazon Post page not loading.
  • Fix to the Shortcode for amazon-elements.
  • Added a container parameter and container class parameter to the amazon-elements shortcode to make styling multiple ASINs easier.
  • Fixed Readme.txt file for screenshots for WordPress repository.
3.5.1
  • Basic template integration (for future use – or if you are good at hooks and filters and can figure it out on your own – go ahead – the structure is there!)
  • Removed traces of Developer Keys at Amazon’s request.
  • Added Amazon Elements shortcode to add bits and pieces of a product to a post – very handy for making a custom layout.
  • Added Amazon Cache Viewer – allows you to manually delete a product cache to initate a new amazon Call. Caches are stored for 60 minutes and updated as the calls are needed.
  • Added Getting Started page to help users set up affiliate and API Key signup. This is becoming more and more complex, so a little help was needed.
  • Added Shortcode Help Page to give examples of how to use the shortcodes effectively.
  • Added feed driven FAQs page – easier for me to update FAQs on the fly that way.
  • Added several Filters and Hooks – will lay them all out in next revision.
3.1 to 3.5.0 were development versions.
3.0 (beta only)
  • Added New Shortcode
    [AMAZONPRODUCTS asin="B0084IG8TM"
    ]

    (instead of

    [AMAZONPRODUCT=B0084IG8TM
    ]

    ) – old method will still work

  • Added Bulk API Call to limit number of calls to API (can use up to 10 ASINs at one time)
  • Updated the depricated function calls
  • Increased API return values for use in theme – puts all items in the array now
  • Updated styles to include some new elements
  • Updated database field for amazoncache table to allow for larger data size of cached XML body (as API can now return up to 10 itmes at a time)
  • Updated aws_request function
  • Wrapped generic helper functions in !function_exists wrapper to eliminate conflicts with some other Amazon plugins.
  • Updated Install function with styles and database upgrade
  • Added amazon icon button to editor to easily add shortcode.
  • Added new parameters to shortcode to allow custom additions to any post/page:
  • asin – this is the ASIN or ASINs up to 10 comma separated
  • locale – this is the Amazon locale you want to get the product from, i.e., com, co.uk, fr, etc. default is your plugin setting
  • desc – using 1 shows Amazon description (if available) and 0 hides it – default is 0.
  • features – using 1 shows Amazon Features (if available) and 0 hides it  – default is 0.
  • listprice – using 1 shows the list price and 0 hides it – default is 1.
  • partner_id – allows you to add a different parent ID if different for other locale – default is ID in settings.
  • private_key – allows you to add different private key for locale if different – default is private key in settings.
  • public_key – allows you to add a different private key for locale if different – default is public key in settings.
  • New Shortcode would be used like this:
    • If you want to add a .com item and you have the same partner id, public key, private key and want the features showing
      [
      AMAZONPRODUCTS asin="B0084IG8TM" features="1" locale="com"
      ]
    • If you want to add a .com item and you have a different partner id, public key, private key and want the description showing but features not showing:
      [
      AMAZONPRODUCTS asin="B0084IG8TM,B005LAIHPE" locale="com" public_key="AKIAJDRNJ6OU527HKGXQ" private_key="Nz3FYyeVysc5yjcZwrIV3bhDti/OGyRHEYOWO005" partner_id="wordseen-20"
      ]
    • If you just want to use your same locale but want 2 items with no list price and features showing:
      [
      AMAZONPRODUCTS asin="B0084IG8TM,B005LAIHPE" features="1" listprice="0"
      ]
    • If you just want 2 products with regular settings:
      [
      AMAZONPRODUCTS asin="B0084IG8TM,B005LAIHPE"
      ]
    • If you want to add text to a product:
      [
      AMAZONPRODUCTS asin="B0084IG8TM"]your text can go here![/AMAZONPRODUCTS
      ]

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)