Amazon Carousel Widget

The Amazon Carousel Widget enables you to render a rotating gallery (carousel) of amazon products. Amazon provides you with the option to specify specific products by providing a list of ASINs, or those matching your specified keywords. To makes things even simpler they allow the output of Most Wished For, Bestsellers and similar categories as well.

Amazon Carousel ShortCode

The Amazon Carousel Widget can be inserted into your website’s posts and comments through the use of the amazon_carousel ShortCode.

The ShortCode interface fully supports all widget options that are defined in the properties section.

Amazon Widget PHP API

When developing the plugin we felt that it was necessary to enable users full flexibility in where they want to place the Amazon Widgets. For this purpose the AmazonWidget class was created that exposes the static Carousel method that can be used to output an Amazon Carousel within the php code of your WordPress Theme. The Carousel method like all methods in the API take an associated array of supported properties as it’s only value. To make things easier it allows you to use either the Amazon or ShortCode property name.

AmazonWidget::Carousel( array( "WidgetType" => "Bestsellers", "title" => "Amazon Best Selling Books" ) );

Amazon Carousel Properties

The below information is sourced from Amazon’s Widget Source web page with a few modifications for ease of use and inclusion of ShortCode references.

Common Properties

Parameter ShortCode Description
tag tag Your Associate id
width width Widget width in pixels
height height Widget height in pixels
title title Widget title
widgetType widget_type Determines how products will be added to your Carousel. Valid values include ASINList, SearchAndAdd, Bestsellers, NewReleases, MostWishedFor, MostGifted
shuffleProducts shuffle_products Set to True if you want the widget to show products in a random order each time it is displayed
showBorder show_border Set to True if you want a black border around the widget

Widget Type: Bestsellers, NewReleases, MostWishedFor, MostGifted

Parameter ShortCode Description
searchIndex search_index Determines the Amazon category used for adding products to the widget.
Click here for a list of valid SearchIndex values
browseNode browse_node Determines the Amazon sub-category used for adding products to the widget.
Click here for a list of valid BrowseNode values

Widget Type: ASINList

Parameter ShortCode Description
ASIN ASIN Comma-separated list of ASINs that will be added to the widget.

Widget Type: SearchAndAdd

Parameter ShortCode Description
searchIndex search_index Determines the Amazon category used for adding products to the widget.
Click here for a list of valid SearchIndex values
keywords keywords Search keyword used when WidgetType=’SearchAndAdd’.
browseNode browse_node Determines the Amazon sub-category used for adding products to the widget. Not applicable when WidgetType=’ASINList’
Click here for a list of valid BrowseNode values

Want to display the Amazon Carousel Widget on your website? Then install the WordPress Amazon Associate plugin today by downloading the plugin or installing through your WordPress Plugins Admin Panel.

Comments & Questions

  1. Not sure what happened but your plugin started conflicting with my basic WordPress functionality. Sometime after upgrading to 3.5.2 (not sure when), the MCE interface for all posts and pages vanished, as did the related text for each page and post (in the back end only), the articles were still visible on the front end of the site

    After disabling and enabling each plugin, I narrowed it down to yours. I tried uninstalling, reinstalling, etc, to no avail.

    I have switched over to “Amazon Link” and I am back up and running.

    I noticed that when uninstalling your plugin that my specific data associated with your plugin remained intact. I was hoping you would tell me which tables your plugin creates in WordPress so I can delete them. I was also hoping you would tell me if your plugin installs data in tables it does not create? If so, where?

    I suspect my issue is one of database corruption and I would like to hunt it down.


  2. I’ve been having the same problem as Peter. It all worked great until yesterday and now when I try to insert a carousel I just get blank space. If I right click on the blank space I get “Movie not loaded” and About Adobe Flash …

    Did Amazon change something?

    1. Tom, looks like there was an issue on Amazon’s side yesterday. Can you please confirm if the issue still persists? If so can you send me the direct code you are using so i can review? I’ve tested the details sandy sent and they work in my site and on Amazon’s Associate Widget Preview page.

  3. Been using the carousel widget successfully for several weeks. This morning, the carousel display vanished from the site. I attempted to remove it and then replace it, to no avail.

    Any suggestions as to how I might trouble shoot this?

    1. I am seeing the same thing. Extended item (single) are displaying but not the Carousel. Looked all over the AWS site for any indications of errors, and didn’t see anything.

      Could they have changed the file –

      Just looking at this now too.

      1. Also as a Note, the Preview of the Carousel does not show up either. Not sure where to look, but looking 😉

      2. Created a simple Carousel on the Amazon Associates page and tried that on a blog page and it works OK. It’s a different style of code I’m guessing.

        BTW this is in wp – 3.4.2

        Code Generated for the Carousel that is not displaying is –

        var amzn_wdgt= { widgetType:”ASINList”, width:”600″, height:”200″, ASIN:”B000SZZA70, B007U1FEPS, B008D6T4NM, 0062101676, B00000633F, B00000JMOF, B004SIP92O”, shuffleProducts:”True”, showBorder:”False”, marketPlace:”US”, widget:”Carousel”, tag:”briandjilsho-20″ };

        1. Sandy, sorry for the delayed response. I just started looking into this and I still am seeing the Carousel Widget. I duplicated your code within my website as well as the Associate Widget Preview and in both cases it is displaying.

          Can you please confirm you still experience this issue?

        2. Matthew –

          No, I think you responded quickly, thanks!

          The issue seems to be gone, I check the site just now and saw the Carousel’s all working fine. Must have been something on Amazon’s side of things. I look all over Amazon and saw no updates or RED out of services indicators on any of the services that I could find. Must have been someone released some software and didn’t tell anyone 😉 I’ll keep an eye on it and shoot you a message if I see it happen again.

          Thanks for the response no issues on the time it took either, I’m sure you support and have other things going too!


  4. Hello,

    I’m just starting to develop my website and have an odd question. On the Amazon Carousel Widget, in the bottom left corner, it has a tiny “Get Widget” clickable button.

    All the setting for the WAAP are correct (associate tag etc…) so this is just a curiosity to me. It takes you to Amazon to “Get the widget code for your account” for this widget.

    But on the website, clicking on the widget content itself, it takes you to Amazon to shop as it should.

    So how, if there is a way, do I remove that “Get Widget” button from the widget? It will create a distraction to visitors, as they could click on it.

    Thanks for your help!

    1. Hi Jon,

      The widgets are provided directly from Amazon and they do not support removing the “Get Widget” button at this time. I’m currently developing a template engine for the plugin so user’s can create their own widgets with all the content and style they would like. More to come shortly.

      1. Hello,

        Thank you greatly for your prompt response. The WAA is a wonderful plugin.


  5. Problem with carousel widget. I can display best sellers and all the lists generated by Amazon. However, if I try to create a carousel using my list of ASIN #, I get an error saying “the requested content cannot be load, try again later” I tried a varying quantity of items from 1 – 10 and the error is the same. Here is the format I used: 0898620341,1585623350,0880485159,157224710X,0140286438,0060932007,1860542387,0452281326,0553062182

    Any thoughts would be greatly appreciated.

    1. Peter:

      I generate the carousel widget using the plugin for your product list without issue. Are you using WordPress Widgets or the editor to add the carousel?
      [amazon_carousel widget_type="ASINList" width="600" height="200" title="My List Widget" market_place="US" shuffle_products="True" show_border="True" asin="0898620341,1585623350,0880485159,157224710X,0140286438,0060932007,1860542387,0452281326,0553062182" /]

  6. Hello!
    Great plugin, EXACTLY what I wanted. Took a bit of tweaking and searching but all is up and running perfectly. I was just wondering, using a carousel, is it possible to display the price underneath each item?


    1. Nevermind, brain fart. It comes up when you hover on the item 😛

  7. hmmm. The php echo code I pasted in does not look like how I pasted it in. I’m guessing so that you don’t get hit with a sql injection attack or something….

  8. Hey, just wanted to say – terrific plugin, super schweet. It’s a breeze to get everything crackin’ just using shortcodes in posts/pages. I’d like to get it working per your example above with Chris Mitchell, getting the shortcode included in a template, but I am a total PHP dullard. Here’s what I’ve tried to do. I figure there needs to be a tag included in single.php or page.php or where ever we want the widget appearing (depending on how the theme handles its templates). So, have hacked together this include based on what you guys did above:

    “Bestsellers”, “title” => “Amazon Best Selling Books” ) ); ?>

    Which can, I guess, be re-configured to be a widget type of whatever with parameters of whatever. Keywords with values, or ASINs’ with values. But, when I try to drop that in anywhere, above page comments, in the header or footer, it tanks my site.


    Not sure if it’s my ham-fisted attempt at php syntax, or how I’m placing it that’s the issue. Any advice you can offer would be most appreciated, and rewarded with beer 😉



  9. Hello Matthew, and thanks for a great plugin!

    I’ve configured Associate Tag for each Amazon site. I have also installed ip2nation and ticked Enable Geo Localization.

    To ease my tests, I also ticked Enable Locale Viewing for Administrators and chose IT from the Locale to view content as dropdown menu.

    For some reason my carsousel still displayes only products from our primary Amazon site, Amazon US.

    Here’s my short code:

    [amazon_carousel widget_type="ASINList" ASIN="B002QSV6DY,B0063OM9CE,B0063P18KW,B00414WBT4,B004HD2RKM,B005ZA07WQ,B005YTVZR4,B005YTY38C" width="600" height="200" title="selected products"]

    Any ideas what I’m doing wrong here?


  10. Hi, great plugin.

    I am using the WordPress do_shortcode to place the Carousel in my template code which works great.

    do_shortcode(‘[amazon_carousel widget_type="SearchAndAdd" width="550" height="200" title="" market_place="US" shuffle_products="False" show_border="on" keywords="Writer Name" browse_node="" search_index="All" /]‘);

    My question is – is there a way I can use my existing Custom Fields to automatically insert the keywords into the keywords option? I have hundreds of author names stored in a Custom Field called Author and I’d really like to be able to work out how to pull these into the WPAA Shortcode

    I tried variations on keywords=.get_post_meta($post->ID, ‘author’, , true). but I am too much of a PHP n00b to make it work.

    Can you help? Will this cause any problems with the plugin and geotargetting?

    Cheers and thanks again for the great plugin

    1. Hi Chris:

      I haven’t done much with the page driven configuration of the Widgets. It is another item on my long list of to-dos. From the code sample you posted above it looks like you have incorrect syntax on the get_post_meta function.

      keywords = ' . get_post_meta($post->ID, 'author', true ) . '

      The full code should look like the below:

      do_shortcode('[amazon_carousel widget_type="SearchAndAdd" width="550" height="200" title="" market_place="US" shuffle_products="False" show_border="on" keywords="' . get_post_meta($post->ID, 'author', true ) . '" browse_node="" search_index="All" /]');

      Please let me know if that works.

      1. That works perfectly Matthew – huge thanks for the rapid response!

    2. I’m new to blogging and know pretty much nothing about writing code. I upgraded to get Custom Design for the CSS editor feature thinking this would help me put a link to Amazon for advertising through the Affiliate Program. Can anyone give me the “step-by-step Dummy version” of how to do this?

  11. Search by keywords doesn’t seem to be working.

    “SearchAndAdd”, “width” => “600”, “title” => “Best Selling Books”, “searchIndex” => “Books”, “keywords” => “loans”) ); ?>

    I even tried removing the “searchIndex” => “Books” and it just showed bunch of electronics. It’s not recognizing the keyword specified.

  12. I have installed this plug in with the goal of using the ASIN list for the carousel widget. spent close to 2 hours trying to get it to show to no avail
    here is how I inserted code into page…HELP!!!

    [amazon_carousel widget_type='ASINList'; amz_wdgt.ASIN='0061344761, 0470228784, 0062502522, 1594770425, 1879181584, 0060922583'; width="500" title="The Doc Recommends"]

    thanks very much

    1. Teresa:

      Sorry to hear you are having issues. I took a look at the ShortCode you posted and have updated it to the below correct entry.
      [amazon_carousel widget_type='ASINList' ASIN='0061344761, 0470228784, 0062502522, 1594770425, 1879181584, 0060922583' width="500" title="The Doc Recommends"]

      Please make sure that you don’t have any semicolons (;) or amz_wdgt… entries

      Let me know if you have further questions but I would recommend using the A Amazon button to create widgets in posts/pages to make sure the Shortcode is formatted correctly.

      Matthew J. Denton

  13. The carousel doesn’t allow me to input a keyword. I can tab through the other options, but it seems to skip right by the keyword.

    How do I get the keyword added?


    1. Gail:

      The Carousel Widget takes different parameters based on the Widget Type Field. If you want products to be displayed based on a keyword then you need to set the type to “Search And Add”.

      Let me know if you have additional questions.
      > Matthew

  14. Also your keywords parameter does not seem to be working.

    1. Ty, thanks for bringing this to my attention, I seemed to have forgotten that WordPresss will remove ShortCode options that are not part of the default array when using the shortcode_atts method. I’ll update all the ShortCode defaults with empty parameters to resolve and will have a new version available this weekend.

    2. Version 1.2.3 released. Resolving the non-functional parameters in the Widget ShortCode.

  15. Hi there,

    Using the Amazon Widget PHP API doesn’t seem to give you geographically contextual links.

    Is this a bug or just how things are?


    1. Geo Localization of widgets is not supported in the 1.2.x version of the plugin, only product links. I’m currently working on version 1.3 that will support the Omakase (Self Optimizing Links) widget, widget localization, and tinyMCE editor controls to insert widget ShortCode into a post/page.

Add Your Comment