Amazon Link
Provides a facility to insert Amazon product links directly into your site’s Pages, Posts and Widgets and Templates.
Description
This plugin is used to quickly add Amazon products to your WordPress posts and pages. The products can be simple text links, thumbnail images, fullsize images, complex templates or full-blown Amazon flash widgets.
The product links that the plugin generates can be for any of the Amazon domains (UK, US, Canada, China, Germany, Spain, France, Italy and Japan).
The content of the products can be statically entered by the Author, when the link is created, or dynamically refreshed when displayed using the Amazon site that is most appropriate for the nationality of the reader.
The products to be displayed can be specified when the link is created, using the built in Amazon search widget, or dynamically generated by searching the content of the site.
All product links will contain the Amazon affiliate ID of the site author and will be the relevant one for that locale, allowing the author to collect commission on any products purchased through the links.
Key features
- Search Tool to assist authors to create links in posts and pages
- Simple
[amazon]shortcode used to generate product links - Localisation of all links based on the nationality of the reader
- Amazon Product Details Cache to ensure pages load quickly
- Optional multinational popup to allow the reader to choose which Amazon site to visit
- Global options to update the behaviour of all the links on your site
- Ability to locally override the global options using the shortcode content
- Affiliate Tracking IDs for User or by user specified ‘Channels’.
- Flexible template facility to enable the author to quickly create complex content quickly and consistently
- Includes built in templates for the major Amazon widgets (Carousel, My Favourites, etc.).
Quick Start
To quickly add a simple text link add the following lines into an entry (page, post or text widget): [amazon asin=<ASIN Number>&text=<link text>]
Where ASIN Number is the unique amazon number used to identify products e.g. “1405235675″. The Link Text is simply what you want to be shown for the link, e.g. “Mr. Good”.
To utilise one of the templates simply specify the template option with the name of the template to use. For example: [amazon asin=<ASIN Number>&title=<link text>&thumb=<image url>&template=thumbnail].
To take full advantage of the plugin features it is recommended that you have an Amazon Web Services account, and enter the Access Key ID and Secret Access Key in the Amazon Link Settings page. Once your AWS account settings are entered the plugin can be configured to dynamically fill in the templates with live information from the appropriate Amazon site. Alternatively you can use the Amazon Search tool on the Page/Post edit screen to find Amazon products and let the plugin pre-fill the Amazon Link shortcode with all the details needed to create the appropriate template.
To generate a list of products relevant to the content of your site use the ‘cat’ option, to specify where the plugin should search for Amazon product links. This option can be either ‘local’ to search the current content or a list of category ids to search specific sections of your site. For example I use this feature to provide friends and family some ideas for presents. This feature also needs access to the Amazon Web Service API and uses the ‘CartSimilarities’ feature to generate the list of items.
This is created by either putting the line amazon_recommends(<Category>,<Number of Posts>) in your template. Or putting the line [amazon cat=<Category>&last=<Number of Posts>] within a post or page. Where ‘Category’ is a list of category ids to search within (e.g. as expected by the ‘cat’ argument of query_posts function. The ‘last’ parameter is the number of posts to search through.
Latest Version – 3.0.1
- New Feature – Simple Template Manager
- New Feature – Amazon Product Cache to speed up page loading
- New Feature – Add ‘Template Type’ option to identify templates that require no ASIN, or Multiple ASINS.
- New Feature – Search using by ‘ASIN’ if ‘Title’ and ‘Author’ fields blank
- New Feature – ‘country’ modifiers (UK#, DE#, US#, etc.) for Template keywords.
- New Feature – ‘country’ specific shortcode modifiers ([uk], [de], [us], etc.) for any Shortcode keyword.
- Templates Update – Add ‘Amazon Impression Tracking’ to templates
- Templates Update – Add ‘Easy Banner’ template example
- Templates Update – Add ‘Amazon Preview Script’ template, add to the bottom of your post/page or include in your theme’s footer
- Templates Update – Add ‘Multinational’ template, example of using ‘country’ modifiers.
- Bug Fix – Fix filtering of incomplete tags.
- Bug Fix – Move ‘aws_signed_request’ into the Class to avoid name clash with ‘premiumtheme’, thanks to pst61 for spotting.
Development Version
- New Feature – Add basic contextual help to the plugin Settings page.
- New Feature – Validate AWS keys when entered on the Setting page.
- Bug Fix – Check for Creation Date when checking the ip2nation database, thanks to Ken Paulson for spotting
- Bug Fix – Search Links not being generated when ‘globalise defaults’ set.
Installation
- Install either via WordPress Plugin Installer (Go to:
'Plugins' > 'Add New'admin page and Search Plugins using the term'amazon link'). Or by uploading the files to your server (in'/wp-content/plugins/') after downloading the amazon-link plugin from the Plugin Directory - Activate the plugin through the ‘Plugins’ menu in WordPress.
- Update the settings (at the very least enter the default Affiliate Tags)
- If you wish to use the advanced functionality: Wishlists, Search, Media Upload facilities or the live data option you must also set up an Amazon Web Services account. So that you can update the AWS Public and Private key settings.
- If you wish to use link localisation then you need to install the ip2nation database using the option in the Amazon Link Settings page.
- If you would like to take advantage of the Amazon Link Product caching then you will need to enable this on the Amazon Link Settings page.
- Insert links and wishlists into your content using the [amazon] tag as described above, or using the Amazon Link box on the Page/Post edit pages.
More Info
If you have any questions about the plugin, please check the Frequently Asked Questions section then either post a comment to this post or check the WordPress Forums.
Further information on the Plugin can be found on these pages:
Donate
Grateful for any contributions towards the development of the plugin.
@Matthew
Hi Matthew, That template should work fine and I don’t think its a problem with the plugin itself.
I’ve had a look on the Amazon Web Services forum and it appears this is a known problem with the Amazon API. There is a work around and I will try and put a bug fix version out shortly. This will at least give you some sort of price for the items you have on your site. The only item I can’t get working is the Kindle, no matter what I try I can’t get a price back for this item!
Cheers, Paul
Is there a way to wrap text around the iframe box? Thanks.
@Kimberly
Hi Kimberly,
You should be able to style the iframe in the same way as you might an image, so one way to achieve what you want might be to make the iframe float to the left or right then the text will wrap around it as appropriate.
You can do this by entering the Amazon Link Settings page, then go down to the ‘iframe image’ template and select ‘Copy’. This should create a new template ‘iframe image1′. Change the name to something more meaningful like ‘iframe left’. Then edit the content of the template:
There should be something like:
style="width:120px;height:240px;"in the template. Just change this to readstyle="width:120px;height:240px;float:left;"and when you use this template your paragraph should wrap around the iframe.There’s probably lots of better ways to do this but I know this works for me!
Cheers,
Paul
I LOVE this plugin (though I’m not currently using it) – this is EXACTLY what I am looking for to get Amazon products onto a new site I started just last night – wesleyanbooks.net
I know enough code to get by, but not enough to really be dangerous (unless breaking my blog every month or so qualifies as ‘dangerous’). I would LOVE to find a repository of template-ideas for this plugin. I had to give up after midnight last night trying to create a template that suited my site-design. If there was a code & screenshot page that listed user-created templates, I would leap for joy!
@Paul
Thanks for looking into that, I’ve come to the same conclusion myself, Amazon doesn’t publish kindle e-book prices via the API. Phoey.
@Paul, it would be wonderful if we were able to choose what to display if the price is not available (currently set with amazonSearch.php:260-263). If it’s not high on your priority list, I’d be happy to code it myself and send you a patch. Just let me know. Thanks!
@Stevan Sheets
Hi Stevan,
A template gallery is a really good idea, but I’m not sure how large a user base there is to support it. I don’t have the time to set it up myself, but you could always start a WordPress forum Topic at: http://wordpress.org/tags/amazon-link?forum_id=10.
I was intending to improve the template aspect of the plugin at some point (mainly for when I update or add new templates to the default set). Any suggestions in this area are always welcome.
Thanks,
Paul
@Matthew
Hi Matthew,
You can already set the price manually if you want by putting any keywords in the shortcode, these should override what Amazon returns. For example
[amazon asin=B004IK8MAI&price=£3&template=wishlist]should set the price to ‘£3′.Thanks,
Paul
Don’t get on with plugings, mostly to complicated for me but this one, It’s simple and it works , what more can you want, good work, thank you.
Hi! Thanks for the great easy plugin. I was wondering if there was a way for this plugin to alter the RSS feed to show the iframe code instead of the Plugin Callout for the iframe?
Hello, I’m trying to get a link inserted with either a thumbnail or an iframe, but the link continues to come out as Text only. I’ve tried to access your technical info and settings & shortcode info pages, as linked above, but when I click on them, I receive an Error 404 every time. Have the help files been moved?
@Gayze
Hi Gayze,
I can’t see a problem with the help page links, do you mean the ones pointing to: http://www.houseindorset.co.uk/plugins/amazon-link/other_notes (for the settings & shortcodes link)?
How are you generating your shortcodes? Using the ‘Add Amazon Link’ helper box, or manually?
The shortcode in your post should contain the item
'template=thumbnail'at least, for example:[amazon asin=1409308847&template=thumbnail&live=1]Can you cut and paste the shortcode content you are using?
Paul
Hi Paul,
thanks for building this plugin!
Maybe it’s just me but where do I find the search tool?
@debjay
Hi debjay,
I’ve been having some problems with the search results not coming back, so I’m currently bug fixing it. It should work for music & books though.
On the page or post edit pages in WordPress there should be a box called ‘Add Amazon Link’, in that box the second section is ‘Search Amazon for Products’. Fill in the author/artist/manufacturer/brand and/or title, select a Product Index, then hit the Search button (do not hit enter as this is taken as Publish Post by WordPress).
It should produce a page of 10 results, select + or – to navigate to the next or previous page of results.
Cheers,
Paul
Hi Paul,
thanks for getting back to me so quickly!
Unfortunately, the search option isn’t there. Here is what I get below my post box:
Enter the following settings for a simple Amazon Link
ASIN
Link Text
Template
Channel
Enter the following settings for an Amazon Wishlist
Post Category
Number of Posts
Wishlist Type
Advanced settings
Use Defaults
Also localization is not working, it keeps sending me to amazon.com and I’m in germany.
@debjay
Hi debjay,
The search box only works if you have entered valid Amazon AWS Keys in the settings page, you can get these from http://aws.amazon.com/.
Localisation only works if you have installed the ip2nation database, you should see a prompt at the bottom of the settings screen if this is not installed.
Cheers,
Paul
thanks, inserting the AWS key did the trick.
I did install the ip2nation database earlier and it didn’t work. clearing the cache seems to have solved that though!
thank you very much for your help and this wonderful plugin.
Amazon product links directly into the Page, works well, thank you,
I’m having trouble figuring out how to fix an issue that I inadvertently caused. I accidentally enabled the localization function without installing the ip2nation db and now the plugin is hosed. I can’t even update the settings without installing ip2nation, which I’m trying to avoid. Where are the settings stored? I’d like to be able to edit a file or database table to remove the localization option but I can’t figure out where to find the settings.
@scottb
That really shouldn’t have stopped the plugin working, I shall look into it…
In the mean time if you a re confident working around mysql, you need to find the item in the ‘_options’ table in your wordpress database that has the ‘option_name’ = ‘AmazonLinkOptions’.
If you have phpmyadmin install you could try editing the option, just change the “1″ after “localise” into a “0″. Or delete all the options with something like:
DELETE FROM `DB_options` WHERE `option_name` = 'AmazonLinkOptions'You need to change the ‘DB_’ in ‘DB_options’ to suit the name of your wordpress installation.
EDIT:
I can’t recreate the problem with my version of the plugin, if I remove the ip2nation database it just defaults to the ‘US’ domain all the time. I have tightened up the error checking in the ip2nation part of the plugin to resolve this problem. Any more info you can give would be helpful, thanks!
Paul
hi
i could not activate your plugin, can you help me in this regard
here is the massage i got when i activate your plugin
Fatal error: Cannot redeclare aws_signed_request() (previously declared in /home/petfoodc/public_html/wp-content/plugins/amazon-product-in-a-post-plugin/inc/aws_signed_request.php:287) in /home/petfoodc/public_html/wp-content/plugins/amazon-link/aws_signed_request.php on line 128
@tahir
Hi Tahir,
I’ve fixed that clash in the development version of the plugin, you are welcome to give it a try but you have to manually install it (as per the current installation instructions). Be aware that this version is still being tested so may have other bugs!
Download it here: http://downloads.wordpress.org/plugin/amazon-link.zip
Paul
Paul,
Installed plugin today and had the following problems:
1. I keep getting Error 404′s all over your site, can’t access any of the documentation that is linked on the plug-in page, FAQ, settings, shortcode info… nada!
2. The Amazon Link is nowhere in my WP ‘Post’ page, where should it be? Is there some conflict with WP 3.3.2? Do I need to restart? WAT?
I’m knowledgeable php and html so got parts of it working longhand, but that is NOT the point…
Thanks,
David
@David Petraitis
Hi David, Thanks for your comment not sure why you are getting the 404′s all the pages work for me. Can you have another look starting from http://www.houseindorset.co.uk/plugins/amazon-link/? If you find any links that don’t work please post them on here (plus where you linked from – i.e. the source of the malformed link). This would be very helpful, thanks!
The Amazon Link shortcode builder on the edit post/page admin screen should be somewhere below the main edit window. No restart should be required, and I am now using 3.3.2 and it works fine for me, so that should not be a problem.
If it isn’t displayed on the page try opening the ‘Screen Options’ tab near the top of the page and make sure ‘Add Amazon Link’ is selected as one of the items to display.
As the look and feel of the administration screens are completely customizable by you I can’t tell you exactly where it should be or even if it is displayed !
Hope this helps,
Paul
I’m having a few issues with this plugin and I just started digging in to the various issues. The first issue is that on the settings page it always says that I do not have the ip2nation db installed even though I do.
The issue seems to be that the plugin looks at the Update_time on the table, but in my newly created table it’s NULL:
db_info:stdClass Object(
[Name] => ip2nation
[Engine] => InnoDB
[Version] => 10
[Row_format] => Compact
[Rows] => 53894
[Avg_row_length] => 48
[Data_length] => 2637824
[Max_data_length] => 0
[Index_length] => 1589248
[Data_free] => 4194304
[Auto_increment] =>
[Create_time] => 2012-04-24 22:01:54
[Update_time] =>
[Check_time] =>
[Collation] => latin1_swedish_ci
[Checksum] =>
[Create_options] =>
[Comment] => )
Changing the storage type on the table to MyISAM fixes that issue. I think you should create the table with that specified or at least show any error on the settings page saying it has the wrong storage type rather than just failing to detect it.
With that solved, I still can’t manage to get anything other than basic text links to show up and I’m not sure what I’m doing wrong. I added 2 of the sample shortcodes from the FAQ to this post, but nothing shows:
http://swtor-crafter.com/blog/new-feature-companion-affection-tool/
@Ken Paulson
Hi Ken,
Thanks for finding the ip2nation problem, I’ll add code to fix it in the next version.
As for the plugin not displaying any output, can you double check that your AWS keys are valid? This is a symptom of these not being set correctly, try turning off ‘live data’ in the settings – you should get some output (just mostly ‘-’ s and not found images).
I will try and add some better code to check the validity of the AWS keys in the next version.
Thanks for persevering!
Paul
With Live set to 0 one shows up with as a broken image and the other not at all. I copied and pasted the keys and double-checked them. They appear to be correct.
@Ken Paulson
Hi Ken,
Very frustrating, for some reason the plugin is failing to lookup the product details using the AWS itemLookup call.
I have added some code to do a simple lookup request on the plugin Settings page whenever you update the AWS keys – To help check for valid AWS keys.
I’m pretty sure your keys are valid, but the request might fail for some other reason, this might provide a clue.
Could you download the development version @ http://downloads.wordpress.org/plugin/amazon-link.zip, and then try making your AWS key wrong – update the options, it should display an error message below your AWS Key. Then put the correct key back update the options and the ‘Valid keys’ checkbox should now be ticked.
If this all goes as expected, you might want to try uncommenting a couple of lines in the file amazon-link/include/awsRequest.php that start ‘
// echo "<!-- REQ: ...‘ and ‘// echo "<!-- RESP: ...‘. Then have a look at the page source to see what the request and response are.Thanks for trying,
Paul
The new version is validating my keys so when I get a chance to sit down with it some more I’ll tinker with awsRequest.php and see what it can tell me.
Hey Paul,
This plug-in doesn’t seem to be working at all for me. Any suggestions? Turned off all the AWS settings in the plug-in settings, put in the proper ASIN and selected a bunch of different templates. Absolutely none are showing up for the product. Very odd and frustrating to say the least. Any assistance would be great. Thanks!
- Dillon
All I’m trying to do is get a thumbnail of the product to show up on one of my pages… Thanks so much
@Dillon
Hi Dillon,
If you are not using the AWS settings then you need to manually provide all the items the template needs, so to display the thumbnail template you need to ensure the shortcode contains something like ‘
[amazon asin=B005Y5CZ2W& template=thumbnail& title=In a World of Wireworks&thumb=http://ecx.images-amazon.com/images/I/611wKFMg%2B0L._SL500_AA280_.jpg]‘.For info, I can see the iframe amazon link on your website, this appears to be working at least. Be aware that adblocking software in your browser may block any of the Amazon Javascript Widgets (e.g. iframe, Carousel, My Favourites, etc.).
If you are still having problems, put a thumbnail on your site, turn on the debug option and I’ll have a look to see if I can work out what is going wrong.
Thanks,
Paul