Amazon Link
A plugin that provides a facility to insert Amazon product links directly into your site’s Pages, Posts, 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.).
- Facility to extend and modify the functionality of the plugin using WordPress filters
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.4
- New Feature – Amazon Link Helper Box added to all custom Post types
- New Feature – Add ‘Extra’ plugin manager to allow installation of user provided features, e.g. The addition of an ‘%Editorial%’ keyword to display Amazon ‘Editorial Review’ content
- New Feature – Add ability to change the ASINs used to generate the template previews
- New Feature – Add ‘List Price’ and ‘Offer Price’ Keywords
- Bug Fix – correct multi-ASIN argument handling
- Bug Fix – fix typo in UpgradeSettings.php
Development Version
- New Feature – Re-organise Settings pages and update Contextual Help
- New Plugin (BETA) – Add Redirect links an ‘Extras’ plugin to create links in the form
www.domain.com/al/0123456789that auto redirect to the appropriate Amazon site. - New Plugin (BETA) – Add a database of predefined shortcodes accessed using a unique References ID
- New Plugin (BETA) – Add a facility to search for and replace shortcodes in post content
- New Plugin – Add a facility to change the size of the images retrieved from Amazon (BETA plugin)
- New Feature – Ability to Export existing templates to a plugin file
- New Feature – Add new keywords PUB_KEY, BUY_BUTTON
- New Feature – Add new Amazon Link type ‘URL’ so can manually specify the link destination
- New Feature – Add simple Rules to Channels
- New Feature – Option to disable User specific Affiliate IDs
- New Template – Add To Cart Template added
- Bug Fix – Change the way templates are processed, to improve page performance
- Bug Fix – Update settings page to correctly handle 1 or 2 column mode
- Bug Fix – Update multinational ‘popup’ to reposition itself if not in correct screen location.
- Bug Fix – Remove various warnings when DEBUG enabled, and some CSS errors
- Bug Fix – Conditionally add contextual help based on WordPress version
- Other – Rework plugin to allow more customisation of the data retrieved and how it is displayed.
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.
Hi Guys,
The plugin is giving me an error when getting into the settings, after installing it. The error that’s coming up is:
Fatal error: Cannot use object of type WP_Error as array in /public_html/wp-content/plugins/amazon-link/include/ip2nation.php on line 43
I tried installing the IP2nation plugin – but that didn’t help.
Could you lend a hand?
Cheers!
Hi Ayden, I’ll look into it…
Seems link the ip2nation site is down and the request to check the current version of the database is failing. I’ll update the plugin to fail more gracefully. However longer term it looks like I may have to use another ip address lookup method.
Dear Paul, Thanks for your plugin which I think is good. I just wondered whether it would not be easier to direct the customer from the UL right to amazon UK instead of displaying the flag because 1. the flag are irritating for someone who does not know the plugin 2. the flag of the default country is not displayed which might confuse some readers. Of course you get to the default country by clicking the link but who knows that?
3. Altogether, I think it would be much smoother if the plugin would just direct the user to the most appropriate amazon site. What do you think?
Hi, Thanks for the feedback, if you don’t want it to display the flags, simply un-select the “Multinational Link” option in the settings page. Also make sure the “Localise Amazon Link” option _is_ selected then the link will be targeted to the most appropriate Amazon site. The reason I put the ‘flags’ in was because the detection of users country of origin using their IP address is not perfect, someone in Alsace or Belgium presented with the link to the French Amazon site might get annoyed if this was the only option. Hope that helps.
Trying to activate your nice sounding plugin only results in “Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /[path]/domain.com/html/wp-content/plugins/amazon-link/amazon.php on line 427″
WP 3.0.5, php4 (will try it with 5). Please advise… thanks
Hmmm,
I have to admit I have only tested it using PHP version 5, so I suspect you are right in thinking this is the problem.
Although I am hoping to do another version soon (with extra support for image based links) but I doubt I’ll be able to remove all the PHP5 dependencies, sorry! I’ll also add a note to state that only works with PHP5.
Paul
Hi,
is there a paramter that makes the link open in a new window? With the default setting, the link to Amazon open in the same window, which I don’t want.
Thanks and regards…
Silly question, I’m sure, but the link that’s generated with the ASIN (which works perfectly) doesn’t show anythign that suggests it has my Amazon Associates number embedded – can i be sure it is? (i.e., that I’ll get credit for referring the customer?)
thanks
@sthe
Hi, there currently isn’t an option to change the target for the link, but I’ll put it on my list of things to do for the next version.
@Bob
To verify that your associate ID is included in the link: The link should contain something like ‘tag=XXX’ where XXX is your associate ID for your preferred locale. Check out the example links on this page. Have you got ID’s for all locales?
Paul, Thanks, here’s the link I get:
[amazon asin=0743297326&text=The Judgment of Paris]
am i supposed to have IDs for all locales? I just filled in for U.S.
@Bob
When the link shortcode is added to your post it does not include your ASIN ID. When the link is created and displayed on your site the ID is taken from your settings. If you preview your post then hover over the amazon link, you should see that it contains your tag.
You only need IDs for other locales if you think you will get a lot of visitors from them. To do this you need to register for each amazon locale separately, which is a bit of a pain!
Paul, thanks very much, I did as you said and I can see my ASIN ID.
all best,
Bob
hi, how i can get works shortcode [amazon cat=3&last=15] in sidebar? now it works like plain text.
thanks
Hi, The best way to get the Amazon link items in a sidebar is to edit your themes sidebar template, I haven’t put widget support in as I do not use it.
You need to add something like this to the sidebar part of your theme:
< ?php if (function_exists('amazon_recommends')) : ?>
<h2>Amazon</h2>
<ul>< ?php echo amazon_recommends(3,30); ?></ul>
< ?php endif; ?>
It’s the ‘echo amazon_recommends(3,30)’ that creates the list, you could also use ‘echo amazon_make_links(‘asin=XYZ&text=”My Link”‘);’ to insert a product link.
The wishlist generated needs at least 320px wide sidebar to work, you can change this by added a userstyles.css file to the plugin directory, with something like this in:
.amazon_container {
min-width: 300px; # Width of the sidebar - 10px margin
margin-right:10px;
}
.amazon_img_container {
height:80px; # About a 1/4 of the sidebar width
float:right;
border:1px dotted;
padding:5px;
margin-right:0px;
width:80px; # About a 1/4 of the sidebar width
}
Paul, thanks!
can you add feature to get 1 product with title, price, thumb, like in related table, but not all products
for example – AmazonSimpleAdmin plugin, you can see on screenshot http://s.wordpress.org/extend/plugins/amazonsimpleadmin/screenshot-3.jpg?r=383998
I can add an option to change the number of items in the list if you like. I’ll put this in the next version.
I was also thinking of doing a template facility, which also could produce the result you are after.
thanks, it would be great!
Hi Liv & Paul,
Great plugin!
A question on install: in the setting
‘Enter your affiliate tag for United States.’
What the ‘tag’, you mean Amazon Associate ‘Tracking ID’ or anything else?
and
‘AWS Public Key’ you mean ‘Access Key ID’?
‘AWS Private key’ you mean ‘Secret Access Key’?
Yes, you are correct ‘affiliate tag’ is your ‘Tracking ID’ found on the Affiliate site. The ‘AWS Public and Private Keys’ are indeed the ‘Access Key ID’ and ‘Secret Access Key’ found under the Access Credentials section of the AWS site.
Hi,
I do have a question now – I received this error message
Fatal error: Out of memory (allocated 67895296) (tried to allocate 44305651 bytes) in /home/mschrist/public_html/www.insightfulmommy.com/wp-content/plugins/amazon-link/amazon.php on line 436
I deactivated the plug in and now it is all working well, but I really like this plug in and would like it on my site.
I also could not get my other SEO plug in to work, but since deactivating the Amazon one, it is functioning again.
And advice would be appreciated. I am hoping I just typed something in wrong in setting it up.
Thanks!
@Christine
Hi Christine,
I don’t think the plugin should be using too much memory, it uses roughly 400Kbytes on my site out of a total 16,000Kbytes used by WordPress + all of my plugins.
68,000Kbytes used by your site does look a tad high though, could be some odd interaction between the AmazonLink plugin and the SEO one?
You can increase the memory limit in wp-config.php, look for the line like this:
define('WP_MEMORY_LIMIT', '96M');
Hello,
after activation i got the message that the plugin generated “Unexpected output during activation” a certain amount of characters.
“If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.”
Now is this somthing to worry about?
I am using wp 3.1.3
Kind regards, Viktor
@Viktor Leberecht
Hi Viktor,
No its not something to worry about I will fix the problem in the next release of the plugin, it only affects the plugin activation not the day to day operation. Thanks for bringing it to my attention!
Cheers,
Paul
Hi Paul,
after installation following error is present.
“Templates”
“Warning: Invalid argument supplied for foreach() in /var/www/tobias/blog/wp-content/plugins/amazon-link/include/showTemplates.php on line 97″
I´m also using wp 3.1.3
Regards
Tobias
@Tobias
Hi Tobias,
Yes, that is a pain – I’ve fixed it in the development version, will do a bug fix release later today.
Thanks for spotting!
Paul
@Paul
Installation worked with the updated version, and thanks for giving me credit for reporting the bug. Now i´m sure i wil come back witth lots of questions about getting it to run
Kind regards, Viktor
Hi, I installed you plugin and was very excited about the carousel feature.
However, if I add a carousel to a page, it doesn’t show. What should I do to make it work?
@Alberto
Hi Alberto,
Unfortunately Amazon does not fully support some of the widgets on all its sites. They are only supported for Amazon.com, Amazon.co.uk, Amazon.de, Amazon.fr and Amazon.jp.
This may be why the widget is not working, also be aware that some adblocking plugins will filter out the Amazon widgets.
Paul
Hi Paul,
I have been using your plug in for text links. I was also using another plug in for image links but they haven’t updated in a long while so I would like to learn how to do images with your plugin. I am trying to put in a thumbnail image and I just don’t understand how to do it.
I tried to put this code in on my post but nothing worked:
[amazon asin=&title=&template=thumbnail].
I definitely know how to get the ASIN number. My text links work on my site.
I see in the settings the thumbnail coding but I don’t understand what to do with it. I guess I will start with a very basic question. Do I copy the coding from the thumbnail in settings to my post. What do the percentage symbols around the words mean? Do I replace them with quotation marks? I know how to fill in src= for the source of the image.
I am sorry I am a beginner so I hope you can help me.
Thanks,
Sandie Anne
Hi Paul,
I just found the way to insert the link at the bottom of the post page. But I am only getting a full size image. What is the name of the class for a thumbnail? I put in thumbnail_image but I am still getting a large image.
Thanks,
Sandie Anne
@Sandie Anne
Hi Sandie,
Thanks for using the plugin, I can see why your original code did not work. The template name is case sensitive and needs to be
template=Thumbnail.So to display the composTumbler you just need to insert the code
[amazon asin=B000H2X2EW&template=Thumbnail]. The title is optional, and only needed if you want to change the title that Amazon provides.I will update the plugin in the next version so that the template name is not case sensitive, this should make things easier!
Using this template should ensure that the image displayed is the smaller thumbnail one, using the ‘Image’ template will show the fullsize image.
You should not need to worry about the content of the thumbnail coding this will automatically be inserted into your post by the plugin. It will replace all the ‘%…%’ items with the correct data.
I have noticed a couple of bugs with the plugin whilst investigating your question, I intend to fix these shortly and issue a new version of the plugin.
PS. I should have read your site earlier, as my Sugar Snap peas have only grown about 3 feet tall (too little sun). I planted them in standard garden compost (mainly oak leaf mulch, also the reason for the shade!). The kids loved them anyway.
@Paul
Hi Paul,
Thanks for the response. Sugar Snaps that are 3 ft tall are pretty good! And it sounds like they were delicious.
I wondered if you could look at my latest post again. The image is so large. It doesn’t seem like a thumbnail size even though it says its size is about 50 kb,
Thanks,
Sandie Anne
@Sandie Anne
Hi Sandie,
Thanks for persevering, that is definitely not a thumbnail image! if your shortcode is similar to the one in my comment above then the problem might be with the template in the settings.
The content of the ‘thumbnail’ template should be something like this:
%LINK_OPEN%<img alt="%TITLE%" title="%TITLE%" src="%THUMB%" class="%IMAGE_CLASS%">%LINK_CLOSE%The important part is the bit that reads
src="%THUMB%".I can get the thumbnail to work on my site: Composter Test Post.
Paul
@Paul
Hi Paul,
That was it! It said image instead of thumb.
Thanks,
Sandy
Hi Paul,
when I create the code to insert in a post, I put ASIN code correctly in the form but then, when I publish the post, the value printed is ASIN=0.
So it din’t work
Here an example of the generated code, once post is published http://www.amazon.it/gp/product/0?ie=UTF8&tag=brividogiallo-21&linkCode=as2&camp=1634&creative=6738&creativeASIN=0
The risult is “no image avaiable”. How can I fix it? Thanks a lot!
@Matt
Hi Matt,
Thought I’d post a summary of our email discussion here as it may help others:
There are a couple of bugs in the version of the plugin (2.0.1), which I have fixed in the development version, that are causing the links to fail. I will try and publish a new version shortly.
Half the problem I think is that Amazon does not fully support the .it domain yet, so the plugin has to use the .fr one for its requests (I chose .fr so at least the prices would be in Euros!).
Also remember that by default the template is populated by the fields that are included in the [amazon] shortcode, one of those fields is the URL to the book cover image ‘image’ or ‘thumb’. So if you have uploaded the image to your WordPress media library you can manually enter the URL to it there.
e.g.
[amazon asin=8830427616&template=thumbnail&title=My Title&thumb=/wp-content/uploads/2011/07/fc18_2010Nientedaperdere-197x300.jpg]Alternatively you can make the plugin get the cover image directly from Amazon. Do this by ensuring that the ‘Live Data’ setting is enabled in the global settings. Or if you only want it for this particular link, add the ‘live=1′ option to the shortcode. However to enable the ‘Live Data’ setting you must be enrolled in the Amazon Web Services and put your Access Key Information in the Backend Setting section.
e.g.
[amazon asin=8830427616&template=thumbnail&live=1]To ensure that the links are to amazon.it, ensure that Italy is selected as the ‘Default Country’ in the Global settings. However when ‘Localise Amazon Link’ is enabled it should link to the amazon.it site automatically.
Thanks for persevering with the plugin, and good luck with your site!
Paul
I couldn’t help but notice that “All product links will contain the Amazon affiliate ID of the site author” and “allowing the author to collect commission on any products purchased through the links” Does that mean that you “The author” of this plug-in make all the money with the links while we put them on our own websites.
Hi Kory,
Thanks for your interest in the plugin. Sorry if it is not clear it means the WordPress site author (i.e. you) not the plugin author. So any affliate ID’s you put in the settings page will always appear in the affiliate links.
If you do not want to bother joining some Amazon affiliate locales that are not primary to your site’s target readership and you have localisation enabled, then by default the plugin’s affiliate ID’s will be used for visitors from those locales. This is partly because Amazon AWS service now mandates that a valid ID must be used for all request.
@Paul
Thanks for clearing that up
I’ve installed your plugin, filled in the various codes and keys, but can’t get it to work. It just displays the raw shortcode instead of converting it into an Amazon link.
It seems to be conflicting with the “Shortcode Exec PHP” plugin that I also have installed.
What I’d really like, though, is not to use a shortcode at all – I want to store the ASIN number in a custom field on my post, and then use a template function to retrieve that and pass it to Amazon Link with whatever settings I want. Is there a template function that calls the [amazon...] functionality the same way that amazon_recommends() does?
@Chris Hunt
Hi Chris,
To add Amazon links to your template you would want to add something like this:
< ?php if (function_exists(amazon_make_links) && get_post_meta($post->ID, 'my_products', true)) { $my_products = get_post_meta($post->ID, 'my_products', true); echo amazon_make_links('template=thumbnail&live=1&asin=' . $my_products); } ?>Then in your post add a Custom field 'my_products' in this case, containing a single ASIN or a comma separated list of ASIN numbers.
Note: Currently the plugin only brings in the 'multinational popup' support if it finds an [amazon] shortcode in the post content - so this won't work if you only use it in template content. I'll add an option to force it to load the scripts if you need this.
EDIT:
I've installed the Shortcode Exec PHP plugin and it seems to work okay with mine. If I define a 'amazon' shortcode in the 'Shortcode Exec PHP' plugin then it gets processed by that plugin first and removes all the [amazon] shortcodes from the post. But can't reproduce your symptoms. If you disable the 'Shortcode Exec PHP' plugin do the shortcodes get expanded?
Hi Paul
When I install the plugin I get an error message in the admin and one on the front end
Admin in the “Template” area:
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
carousel – Amazon Carousel Widget
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
iframe image – Standard Amazon Image Link
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
image – Localised Image Link
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
mp3 clips – Amazon MP3 Clips Widget
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
my favourites – Amazon My Favourites Widget
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
thumbnail – Localised Thumb Link
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
wishlist – Used to generate the wishlist
Front end:
Warning: addslashes() expects parameter 1 to be string, array given in /var/sites/x/siteurl.url/public_html/wp-content/plugins/amazon-link/include/amazonSearch.php on line 298
I wasn’t comfortable publishing the absolute path on the server so I’ve changed the url to siteurl.url
If you want to email me I’ll let you know the correct address if you have any ideas what might be the issue.
Thanks
David
@David
Hi David, I have released version 2.0.4 which should have all the Debug Warnings fixed. Your version of PHP seems to be more strict than the one I have installed. Hopefully that will fix the problem for you.
Paul
Hi Paul,
We just installed it, and when we tried to use the iframe template, we were getting what looked like a dns error (page wasn’t loading). Since we usually like to provide links to both the physical book and the kindle, that seemed to be the best option to have amazon provide links that were obvious as to which link was which.
Also, any plans to add in other book affiliate programs into the same plugin? Google, B&N, Indybound, Powells, etc?
Thanks for the help and the plug in.
@Ross
Hi Ross, Thanks for your interest in the plugin, it seems the US version of the iframe code does not match all the other locales. I have updated the plugin to add support for the US domain ‘rcm.amazon.com’. If you install version 2.0.7 and change the Iframe template content on the Amazon Link Settings page to:
<iframe src="http://%RCM%/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=%TAG%&o=%MPLACE_ID%&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=%ASIN%" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
If cut and paste does not work then in the Templates section, delete the ‘Iframe image’ template then the ‘Wishlist’ template – this will make the plugin re-install the default template.
It should then work as expected.
This plugin is awsome, however I have a small issue:
I use it on a german web site, so all prices for amazon.de are in €.
Now I created an extra link below each “thumbnail” to compare those prices to co.uk since those prices are cheaper nearly all the time.
Now what I would like to do: Is it in any way possible to get the prices of co.uk in € instead of £? That be awsome
I know that thos values are calculated somewhere within amazon.co.uk since I get all my orders in € during ordering process…
Thanks for your help and the great plugin!
@Chris
Hi Chris, Thanks for your interest in the plugin!
The currency conversion would be a nice addition and I’ll look into it. I have had a quick look on the Amazon AWS site and it does not look like this is something that I can get directly from Amazon.
In the short term I would have to just use a third party currency conversion, which would not reflect the actual price that Amazon would charge. This is probably not ideal.
To be honest I would probably prefer to do this as a different plugin, i.e. one that detects currency strings
'£X.YZ'and outputs the conversion automatically'£X.YZ ($A.BC, €D.EF)'.Hey, I’m having trouble getting the price to display for any Kindle books (it displays fine for other items).
Here’s the (HTML removed) code I’m using in the template:
%LINK_OPEN%%TEXT%%LINK_CLOSE% [ %PRICE% at amazon.%TLD% ]
Any thoughts on what I might be doing wrong?
@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
@Paul
Amazing! Thanks so much! This code works fantastic. I really appreciate it!!!!!!!
Hi Paul,
Thanks for great Amazon plugin. I have Amazon PIP almost exclusively for last 2 years and just today I found your plugin, that I see it get updated few days ago. I installed immediately on my brand new site. Hope it work great to replace PIP.
Please keep updated as WP and Amazon always updating.
Cheers,
Hi, installed the program and can find no Amazon Link box on the Page/Post edit pages. I am not using advanced features so do not have the Amazon Web Services account
@Susan
Hi Susan,
On the Post/Page edit page under ‘Screen Options’ at the top of the page is ‘Add Amazon Link’ checked? Not entirely sure why this wouldn’t be but worth a look!
Paul
Hi Paul
Installation went flawlessly but I don’t get any search results returned when looking to insert a link into a post. I have double-checked my AWS keys and they are fine. On clicking search, I get the timer image and then nothing. I have tried numerous categories.
I am not using any cache plugins and have not enabled links cache. Tried in several different browsers too.
thanks for any help
Hi Paul,
great work.
Is it possible to hook Amazon-Link with other post types then post/page? This would make ist easyer to set up a ‘shop’ with serach, categories and own style.
Thx
Marcus
@marcusj
Hi Marcus,
I should think I can get this to work… I’m not sure there is a way for my Plugin to automatically add itself to all post types. However I could include an extra option, to the settings page, that allows you to specify a list of post types to which you want to add the ‘Amazon Link’ box. Do you think that would work?
I’ll look into it further…
Paul
@Paul
Hi Paul,
that is a quick response! For me the proposed solution would be perfect. Alternatively you could let me know where to chance your code, if an update in the setting page is too much work (maybe I am the only one with that need…)
Marcus
Hi Paul!
The plugin is terrific!
Is there any possibility of getting a new variable which is the editiorialreview for use with books? Or, should I just look at trying to set that in the codebase to be used in a template and fork the code?
Thanks again!
@Ed
Hi Ed,
If EditorialReview is something that can be retrieved from the Amazon Web Service I’m sure I can add it – the AWS tends to be a bit sparse on this sort of content. I’ll try and add it to the next version of the plugin.
EDIT: To quote AWS:
Cheers,
Paul
Hi,
Having a nightmare trying to use the amazon shortcode in the index.php of my theme. I can´t use the Shortcode API directly – so do_shortcode won´t work!
I´d like to call the plugin function directly that the shortcode API elaborates to :- i.e where is the function in your plugin so I can make a direct call and not have to use the shortcode at all.
Thank-you!
@Mark Johnson
Hi Mark,
Sorry your having problems with the plugin, you are right it does not use the WordPress ‘do_shortcode’ API as it is not compatible with how the plugin works.
There are two API’s to access the plugin directly, but they have been rather neglected!
You need to put something like this in your template files:
<?php if (function_exists(amazon_make_links)) echo amazon_make_links("template=thumbnail&asin=1841498955&live=1"); ?>To insert a product based on the thumbnail template.
OR
<?php if (function_exists(amazon_recommends)) echo amazon_recommends("local",1); ?>To insert a Wishlist based on the content of the ‘local’ page.
I have added the following ready for the next version which allows you to simply put the shortcode arguments in and it generates the appropriate content:
<?php if (function_exists(amazon_shortcode)) echo amazon_shortcode("template=editorial&asin=1841498955&live=1"); ?>Thanks Paul, that´s absolutely brilliant – worked like a charm first time!
Really great plugin, keep up the fantastic work.
Cheers, Mark.
Hi Paul.
I am having a problem getting My products links to work. I would like to know what information I
have to put in for the Channel….is it my “websit/blog”, or is it a special Amazon affiliate #. Also, do we put an affiliate ID in next to our country (below where we enter the Channel). A bit confused.
Thanks so much, Terry
@Terry
Hi Terry,
You need to put your affiliate ID next to your country flag in the default channel. If you register with amazon affiliate services in other countries (e.g. usually worth doing US if this is not your locale) then add them next to the appropriate flag.
The plugin will not convert existing amazon links automatically you need to add a shortcode to each post where you want to add a link e.g. [amazon asin=0718147707&text=Jamie Oliver Book].
There are other plugins which might convert existing links if you have a lot of existing material.
Hope this helps,
Paul
Hi Paul,
I´ve been trying to figure out if your plugin can access the EditorialReviews response group to get the manufacturers product description and Reviews response group that returns an iframe URL of the product reviews.
I noticed you mention “Add support for ‘Link to Reviews’ rather than the product in templates”, which I guess covers the second one – but couldn´t figure out how to actually use this!
Also, would I be right in thinking the “New Feature – Add ‘%Editorial%’ keyword to display Amazon ‘Editorial Review’ content” covers the first and is for later release.
Thanks again, great plugin!
@Mark Johnson
Hi Mark,
Still ironing out some bugs with the Review Links, however if you add something like:
%RLINK_OPEN%Product Reviews%LINK_CLOSE%to your template it should create a link to the Amazon review page for that product.The support for
'%Editorial%'will be in the next version, you can test the development version of this code by uploading the development version to your WordPress plugins directory, it is available here: http://downloads.wordpress.org/plugin/amazon-link.zipCheers,
Paul
@Paul
Brilliant! Thanks Paul, will go it a go. Cheers, Mark
Hi, Paul. I’ve just moved my blog from a “.wordpress.com” to a self-hosted site in the hopes of using the Amazon Affiliates program. I installed the Amazon Link plugin yesterday afternoon. I’ve put in my AWS Public and Secret keys (the confirmation box was ticked) but STILL, no matter what I do, the “My Favorites” widget will NOT show up in my sidebar after I copy the HTML code into the Text widget. I’m already technologically-challenged and I’m at my wits’ end. I’d appreciate any help you can offer. Thanks!
@Maribeth
Hi Maribeth,
To get the favourites widget to be in a Text Widget you should just need to put something like
[amazon asin=B000056VJ7, B0000025UW, B001LR3576, B001KSJNWC, B001LWZCKY, B001GTPI7O, B001GTAGS0&template=My Favourites]in the text widget (note the UK spelling!).You could start by experimenting with various options in a normal post first then just cut and paste the resulting shortcode into the text widget.
Also bear in mind that some browsers (with ad-block settings) will block the Amazon javascript widgets like ‘My Favourites’.
Good luck with your site,
Paul
Hi Paul
Is it possible to get an Amazon thumbnail to float either left or right so that text flows around it. At present I am only able to get the thumbnail image to appear on its own with white space to the side.
thanks
Paul
@Paul
Hi Paul,
Yes, I have done this by creating a copy of the Thumbnail template then adding
style="float:left"to the first <div>. So I have a template calledthumb leftwith the following content:Hope that helps,
Paul
@Paul
Excellent – many thanks Paul.
I don’t know if it is my theme, but the text is right up against the image – I have tried changing the margin and adding padding to the style but this doesn’t seem to have any effect.
@Paul
Hmmm, that’s odd. Have you tried viewing it using Firebug or Inspecting the elements in Chrome? -They can be good for diagnosing CSS problems.
If I add
style="float:left;margin-right:50px;border:1px solid"to the <div> I get the desired effect – this local style should override anything in the theme .css files.Also make sure any caches are flushed (WordPress or Browser).
Cheers,
Paul
@Paul
Thank you once again Paul – works perfectly with the style changes. I had tried using a CSS tool but couldn’t seem to identify the appropriate element.
best wishes
Paul
Man, maybe I am missing something here… I take my code from my affiliates page for my favorites list, paste it into the template for favorites, see the correct widget show up…. then I go to my widgets control panel and there is nothing there. How do I get the widget to show up in my sidebar along with all the other widgets? Is this an issue with Thesis (the theme I am using).
@TheJerd
Hi,
I haven’t got around to create a widget for the plugin yet, what you need to do is add a standard Text widget to your sidebar and in the text widget put a amazon link shortcode like:
[amazon template=favourites&asin=0123456789]If the template does not need any ASINs then make sure you update the template option ‘Template Type’ to be ‘No ASIN”, then you do not need to put an asin in the shortcode.
Cheers,
Paul
I have the plugin installed here:
http://nyecoinc.com/favorite-books/
and for some reason out of 14 books listed, just one book will not show up properly. The ASIN number for that one is 1451648537 and I’ve triple-checked that the shortcode is in the page correctly. Is this a problem with the plugin or with Amazon? I also couldn’t find the book when doing a search using the plugin directly. Any help would be appreciated. Thanks!
@Sibyl
Hi,
Had a look and I can retrieve the book from all locales so it should work. I see on your site you are now retrieving the Kindle version, try setting it back to 1451648537 and do a refresh.
If I search for ‘Steve Jobs’ using the Amazon-link search tool it (1451648537) comes back as the first result, so its a bit odd! Are you using the cache? It’s possible Amazon returned an error when it first tried to retrieve the item details and that is stuck in the cache? Try flushing or disabling the cache to see if that helps.
Let me know if you need any further help,
Paul
Just put that book back and it still won’t work for some strange reason. Here’s what I have in the shortcodes for that top row:
[amazon asin=0446529117&template=iframe image&chan=default] [amazon asin=1610660137&template=iframe image&chan=default] [amazon asin=1591394139&template=iframe image&chan=default] [amazon asin=038552904X&template=iframe image&chan=default] [amazon asin=0060520221&template=iframe image&chan=default] [amazon asin=1451648537&template=iframe image&chan=default] [amazon asin=0977144119&template=iframe image&chan=default]
Not using any caching plugin at all right now. Any other ideas? I changed it to the Kindle version so we wouldn’t have the broken one on there, but I’ll leave it up for a bit so you can see. I’m happy to give you access if you think it would help, just email me at sibyl at sibyl.com.
Seems really weird to me since other books work fine.
Thanks again
@Sibyl
Hi, Looking at your page the plugin is generating the correct iframe code, but for some reason Amazon.com is not delivering the right content for that ASIN. I can search for ASIN 1451648537 using the search tool and I get the book coming back okay, but if I search for ‘Steve Jobs’ it only returns the Kindle version (using Amazon.com).
It works as expected on all other locales! Must be an Amazon.com anomaly, if you could be bothered you could hard code the iframe content into a new template, that should work.
You could try contacting Amazon but I doubt you’ll get any response.
Good luck, Paul
Hey Paul,
I just tested a number of other Amazon Associates plugins and found yours to be the simplest and most straightforward. Thanks for creating it.
There is only one problem. Even with the localize button activated, the links are directing me (in US) to the UK Amazon site.
Any thoughts?
Thanks,
Daniel
Just figured it out. On the plugin list, you can access settings. Change the default country.
Thanks again.
my problem is install and activate the amazon link but i not sure were to find this ASIN not sure what it mean help please
@jason
Hi Jason,
ASIN is the ‘Amazon Standard Identification Number’ and is a unique ID that relates to a product that can be found on Amazon. For more info see: http://www.amazon.co.uk/gp/help/customer/display.html?ie=UTF8&nodeId=898182
The plugin uses these IDs to create links to the Amazon site and, if you have set the AWS IDs configured, it can get product details from Amazon (price, title, etc.) and display them directly on your site.
Paul
Paul,
Great plugin and it’s working great. Does exactly what I was looking for.
I have one question. Is there a way to resize images when you bring them in. Some of these full size Amazon Images are just too big and the thumbnails are to small.
Thanks
Tom
@Tom
Hi Tom,
If I only have a few links I prefer to bring the image into the WordPress Media library, this will then resize the image to whatever settings you have for importing images. The plugin will try and using images from the media library in preference to the Amazon ones (they are tagged with the product ASIN).
To do this: Using the ‘Insert Amazon Link’ helper on the Post/Page edit screen, enter the ASIN in the top box, hit search then when the item is shown click on the Upload button this will add the ‘large’ Amazon image to your media library. WordPress should create a thumbnail and medium size image to match the ‘Image Sizes’ settings on the ‘Media Settings’ page.
—
The images served are the ones provided by Amazon, which in the past hasn’t been very consistent at providing the images of known quality and size. The AWS does often provide links to other image sizes but I don’t know how reliable that is – I could add an extra feature to try and retrieve different size images?
EDIT: Hmmm, You need the development version of the plugin for this to work (http://downloads.wordpress.org/plugin/amazon-link.zip)
EDIT: First bash at ‘user selectable image sizes’ – install this in your plugin directory amazon-link-image-sizes.php. Make sure you change the name to end in .php not _.txt then activate the plugin. You should get two new options in the Amazon Link Settings page to modify the image/thumbnail height – you should also flush the cache to remove any stale images.
Paul
Wow you are really on top of it. I’ll give it a try and let you know.
Thanks,
Tom
Paul,
I made a quick video of some issues with the new plugin.
http://shared-video.s3.amazonaws.com/Amazon_Link.mp4
Thanks
Hi Tom,
Many thanks for the video very easy to see what’s going on, I developed the extra on my version of the plugin so that’s why it doesn’t work on version 3.0.4.
Two options you could try jumping to the development version (still in testing!). Or you could hack your current version, in the file:
amazon-link/amazon.php: line 1348
change:
if (isset($key_info['Filter'])) $key_data = apply_filters($key_info['Filter'], $key_data, $settings);
to:
if (isset($key_info['Filter'])) {
$key_info['Keyword'] = $keyword;
$key_data = apply_filters($key_info['Filter'], $key_data, $key_info, $this);
}
Hey, hey, hey worked like a charm.
Thanks
Just out of curiosity how do the new settings perform the search? If I put in 300 px does it search for everything at 300 and below or just 300?
Thanks
@Thomas
Hi Tom,
It’s a bit of a hack, which is why it will probably stay as an ‘extra’ for a while rather than go into the main plugin…
The AWS returns a set of images, Large, Medium, Small, Swatch, etc. They all have very similar URLs: e.g. for a 160 high image: ‘
http://ecx.images-amazon.com/images/I/518FFDVWNQL._SL160_.jpg‘.The code finds one image then strips off the end and adds ‘
._SL<image_size>_.jpg‘ to the end. It worked on all the ASIN’s I tried, but I haven’t seen anything that states that this is the ‘correct’ way to get images. So officially it probably isn’t supported.Paul
Thanks for the info.
If it does go into the main plugin you might want to add an over ride for each page or post so that you’re not stuck with the same size image throughout the site.
I think Amazon needs to issue an edict though to the sellers to provide at least one 300 x 300 image. Some of the images are nothing but thumbnails.
Great stuff though on your end!
@Thomas
Hi Thomas,
You can change any of the global settings by adding them to the shortcode, e.g.
image_size=900&thumb_size=200. A bit clumsy if you need to chop and change image sizes alot, plus if the image is already in the cache then the size won’t be updated._If_ it does get into the plugin it might be worth making it a template option e.g.
%IMAGE%900#changes that particular image in the template to 900px high.Paul
Hi Paul,
Is there a way to retrieve the AWS Access key? And the Associate ID? I want to set up a ‘Buy from Amazon.com’ button and tie it to the AWS Access key and Associate ID:
<input type="hidden" name="AWSAccessKeyId" value="">
<input type="hidden" name="AssociateTag" value="">
Great plugin!
@Bruce
Hi,
You can add the Associate Tag in a template by using the keyword %TAG%, you can’t currently automatically expand the AWS Access Key Id – I can add it to the next version if you want.
However you could just hard code it into the template, as it doesn’t change that often?
Paul
@Paul
Hi Paul,
I’m coding this directly into a custom page template, not into the Amazon Link template.
http://pastebin.com/8Vuph9Pc
So I’m not sure that %TAG% would work…
Regarding the AWS Access Key – I prefer not to hard code it into the page template for security reasons (even though the secret key is still unknown). I would prefer to retrieve it from the database if possible.
What do you think? Thanks!
@Paul
Hi Paul,
I have done some investigation into AWS Access Keys, and also Associate Tags. It appears that having either one exposed is not a security issue or weakness. Nothing can be done without the secret (private) key.
It would be NICE to completely obscure them, but I don’t have to. I’ll hard code them both and if you come up with other solutions I can always change.
Thanks for listening
Hi,
If it was me I’d put the form in an Amazon Link template then you could reuse it in other posts (in fact seems like a good thing to add to the standard template set).
Set up a template with a name like ‘buy now’, with the content of the form:
<form method="get" action="http://www.amazon.%TLD%/gp/aws/cart/add.html">
<input type="hidden" name="AWSAccessKeyId" value="%TEXT1%" /><br/>
<input type="hidden" name="AssociateTag" value="%TAG%" />
<input type="hidden" name="ASIN.1" value="%ASIN%" />
<input type="hidden" name="Quantity.1" value="1" />
<input type="image" id="amazonbuy" name="add" value="Buy from Amazon.com" border="0" alt="Buy from Amazon.com" src="http://images.amazon.com/images/G/01/associates/add-to-cart.gif">
</form>
Then in your custom page do:
if (isset($awlfw)) {
$settings=$awlfw->getSettings();
$KEY=$settings['pub_key'];
}
if (function_exists(amazon_shortcode)) echo amazon_shortcode("template=buy now&asin=$ASIN&chan=cheryl shireman&text1=$KEY");
In the next release of the plugin I’ll add the keyword %PUB_KEY% to provide direct access to the AWS Access Key.
Paul
@Paul
Hi Paul,
Ooooooo…. very nice. I never thought of doing it that way, and also was a little short on knowledge in setting up the $KEY and retrieving $awlfw.
This worked very well. Thanks for the time, and I will look for %PUB_KEY% in the next release.
Thanks!
Having trouble accessing the Amazon Link settings. I get this error:
Fatal error: Call to undefined function get_current_screen() in /hermes/bosweb/web198/b1986/sl.mrdadcom/public_html/radio/wp-content/plugins/amazon-link/amazon.php on line 232
Any idea how to overcome that?
Also, some other amazon plugins have a search feature built in so I don’t have to got to amazon to find the ASIN. Is that something that’s part of Amazon Link?
@Armin
Hi,
What version of WordPress are you using? The plugin should work with WordPress 3.1 and above.
Once you have configured the plugin (provided your AWS keys) then the plugin will provide a search function.
Cheers,
Paul
I’m using the most recent version, whatever that is. Question is how can I configure the plugin unless I can’t get into the settings?
@Armin
Hi,
How are you getting to the options page? On my site the URL is something like
http://www.mydomain.com/wp-admin/options-general.php?page=amazon-link-options.With WordPress version 3.5 I can’t see how you would get the error you are, it’s a bit odd. Are you using a standard single user install?
Paul
Hi Paul,
First, thanks for a fabulous plugin.
I’ve just started to test the redirect functionality – I use amazon.com and the US site is the default. I tested spoofing the UK site and found that while I am redirected to the UK, I am only redirected to the front page. Looks to me like the site couldn’t find what I was looking for (though it does exist.) Further investigation reveals that the product does not share the same ASIN between the two sites.
e.g.
US http://www.amazon.com/Gone-Girl-Novel-Gillian-Flynn/dp/030758836X/ref=sr_1_1?ie=UTF8&qid=1360188777&sr=8-1&keywords=gone+girl
UK http://www.amazon.co.uk/Gone-Girl-Gillian-Flynn/dp/0753827662/ref=sr_1_1?s=books&ie=UTF8&qid=1360188808&sr=1-1
Is there a workaround? Perhaps a search for title/author instead?
Thanks
@Pete Rowley
Hardcover UK version (got the ebook in link above.)
http://www.amazon.co.uk/Gone-Girl-Gillian-Flynn/dp/0297859382/ref=tmm_hrd_title_0?ie=UTF8&qid=1360188808&sr=1-1
OK I’ve figured it out. There was one simple problem and one not so simple. First, I’d checked create search links, and then not supplied a search string. Doh! I’d assumed there was a default. And… I didn’t want that anyway, so just unchecked.
The other problem was a lot harder to figure out. But it turns out that the UK locale is special – its numbers work for every other locale, whereas the US locale works for diddly squat outside of the US. So, I had to set the UK as the default country – but because localization now works… it doesn’t matter because all my US peeps will get the right place.
The clue came from some documentation for the python-amazon-product-api : http://packages.python.org/python-amazon-product-api/faq.html#which-locale-should-i-use-and-why-is-this-important
Glad that’s fixed, lol – hope this helps some folk.
@Pete Rowley
Hi Pete,
Thanks for trying the plugin, glad you sorted out your issue! Have to admit I was not aware that the US site had ‘unique’ ASINs for products (although I’m not surprised!). Will update the FAQ next time I do an release.
Thanks,
Paul
…site-admin/options-general.php?page=amazon-link-options
when i am there i have blank page. i had it working perfectly and i thought i would add all in one seo, everything from amazon disappeared so i thought oh!!!so i uninstalled it and then tried to get link to work but it didn’t so reinstalled that but now the settings page is blank, and I way out of my comfort zone. with this stuff. please help.
I turned off addblocker, that my son installed and my web page is back to normal, however the settings page still shows blank for amazon link, now sure excatly when that happened, but I am not freaking out now, LOL. a combination of things were done yesterday and I didn’t check the site after each change so when i did the thing with SEO i thought that’s where the problem was. any fixed except for the blank page.
@Brenda
Hi,
Sorry to here you have been having problems, I guess you are using the latest version of WordPress and the plugin?
Is the page totally blank? Could you do ‘show html/source’ to see if there are any PHP errors? Most likely there is a bug or clash with another plugin that is causing the plugin to fail. Any clues to help diagnose the problem would be helpful,
Thanks,
Paul
Hi Paul,
I’m still trying to figure out the alignment issue. On this page, for example: http://www.mrdad.com/positive-parenting/tough-guys-and-drama-queens-moms-returning-to-the-workplace-caring-for-aging-parents/
I’d like to get all the info about each author and topic right next to the book instead of underneath it. I tried something with floating alignment but ended up with the books tiled on top of each other.
Also, on this page; http://www.mrdad.com/militaryfather/ scroll down a little. I can’t figure out why the book image for Missing Alphabet shows up on this landing page but none of the other books do. Did I check or uncheck a box somewhere?
Thanks much,
Armin
@armin brott
Hi Armin,
HTML and CSS are not really my area of expertise, but the way I do it is to use a combination of float and clear CSS elements. So something like…
<div style="float:left"><img ...><p>Descriptive stuff I want to be shown next to the image</p><br style="clear:both">
As to the second issue, It looks like the ‘landing page’ for the previous posts do not have anything generated by the plugin showing. Do you have any sort of WordPress caching plugin running? How are the excerpts for these posts created, I notice the formatting has been stripped off as well, perhaps this has also stripped the shortcode?
There isn’t anything in the Amazon link plugin options that will cause it to do this, I’m a bit stumped, sorry!
Paul
Paul,
A very belated thanks for the level of support you provide. I really love this plugin. Still having trouble with the text wrapping issue, though. I know you’re not an HTML/CSS expert (still, whatever you know is 100x what I do!), but can you help me with the exact coding to get the image on the left and the text on the right? I’m petrified of making any changes to the WP templates…
Here’s an example of a post: http://www.mrdad.com/positive-parenting/the-importance-of-play/
And here’s what the HTML view of the first entry looks like:
[amazon asin=0465025994&template=thumbnail&chan=default]Guest 1: Peter Gray, author of Free to Learn
Topic: Unleashing kids’ instinct to play
Issues: How play makes kids happier, more self-reliant, and better students for life; play’s crucial role in children’s intellectual, social, and emotional development; how play has changed in today’s tech-filled world
Thanks very much, Paul
Hi Paul,
Excellent plugin – thank you!
I’ve just uploaded your beta from http://downloads.wordpress.org/plugin/amazon-link.zip into a genesis child theme and I get the following error message when I try to access the templates from the menu -
“Fatal error: Cannot use object of type AmazonWishlist_For_WordPress as array in /home/xxxxxx/public_html/mysite.com/wp-content/plugins/amazon-link/amazon.php on line 1019″
I’ve just updated to wordpress 3.51. maybe that’s messing it up?
Hi Mark,
Can’t see why that would cause a problem, I’m also using 3.5.1 with no problems, try using the previous version to see if that helps:
http://downloads.wordpress.org/plugin/amazon-link.3.1.0-rc5.zip
Paul