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.

[amazon_carousel widget_type="MostWishedFor" width="500" title="My Favorite Books"]

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.

18 Responses to “Amazon Carousel Widget”

  1. Biomech says:

    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?

    Cheers

  2. Dave says:

    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….

  3. Dave says:

    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 ;)

    Best,

    Dave

  4. Tero says:

    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?

    Thanks,

  5. 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
    Best
    Chris

    • Matthew Denton says:

      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.

  6. Gnanes says:

    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.

  7. Teresa says:

    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

    • Matthew Denton says:

      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.

      Thanks,
      Matthew J. Denton

  8. Gail says:

    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?

    Thanks

    • Matthew Denton says:

      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

  9. Ty Lee says:

    Also your keywords parameter does not seem to be working.

    • Matthew Denton says:

      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.

    • Matthew Denton says:

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

  10. Ty Lee says:

    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?

    Thanks!

    • Matthew Denton says:

      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.

Leave a Reply