Checking out Amazon on Drupal 6, Part 2

7 Oct 2009

Here's the second installment of my Amazon and Drupal experiments.

First, a note on a topic I mentioned, the recent requirement that Amazon affiliates go to to acquire a new Access Key ID and Secret Access Key: The Amazon module kindly warns you right on your main admin page if your Keys are incomplete or outdated. Here's the message I didn't spot when I was troubleshooting things on my own:

The Amazon API must be configured with an Access Key ID and an Amazon AWS Secret Access Key to function. Go to Amazon API Setttings.

Helpful! All right then, on to a new feature, Amazon Stores:

Testing the Amazon Store module

After the Amazon module itself, the only important-looking related module I've come across is the Amazon Store module. Following the terse documentation on, I gave that a whirl.

The module creates a settings form at admin/settings/amazon_store, plus a link to the store page itself (amazon_store) inside the Navigation menu. The settings are simple, offering only a few store navigation options; a setting for default search category; and the option to pre-populate the store using SearchIndex, a browsenode, or list of Amazon ASINs.

SearchIndex? Browsenode? Lost me there, Amazon Store. I'll look those up later, and for now play with the third option. I know what an ASIN or ISBN is: a product code! So, following the field description that prompts:

"Comma-separated list of up to 10 Amazon ASINs that should be displayed by default on the amazon_store page"

...I nab a bunch of ASINs (or ISBNs) from the Amazon site, paste them into the field, and all aquiver with anticipation, hasten to my fresh store page...

...which displays only one book. After poking around, I find the cause: When this field asks for a comma-separated list, it wants ONLY commas, thank you – a comma and a space stops it dead in its text-parsing tracks. This problem is made worse by the fact that, when pasting space-less numbers into the field, spaces appear on their own. I have to remove a space manually after each pasting of an ASIN. Weird.

(Oh, and the form is a stickler for that "10 item" limit, too, like a picky express lane clerk; try to slip in an 11th product, and it's no store page at all for you.) 

Fine. Spaces deleted, items reduced to 10. (Oh, and an accidental Kindle product removed from the list, too; that at least didn't break the store, it just didn't show in the store page.)

Now it works. Gaze upon the birth of a retail empire at .

You'll notice that the Amazon Store module has created a unique page for each linked product, stocked with Item Description (not necessarily ably formatted...), Product Details, choice of merchants (though why can't this default to Amazon for simplicity?), user reviews taken from, and a list of links to Similar Items. That last bit sounds handy as a way to introduce more relevant products to the user – but alas, the Similar Items links are only to the pages of other products already in the onsite store, not to entirely new products.  

How useful is this?

What's noteworthy about the "store" is that it isn't an immediate jumping-off point to carry users (and your Associate ID) to the real store. Rather, users read about the products, add them to their cart, and continue shopping for more products, all within your site. It's not until a user continues on to checkout that he's diverted to

I'm not sure that that's good from the user's perspective. To "Continue shopping" within your site means – as far as I can tell – that the user is only shopping from a limited number of products you've incorporated, or additional products only if he bothers to search from within your site. Yet barring the SearchIndex and browsenode options that I need to explore, the user sees nothing but your list of 10 or fewer hand-picked products, plus whatever he's searched for on his own.

From my seat of admittedly little experience, it seems preferable that the store page 1) carry as many featured products as I'd like, and 2) promptly send the user to the main Amazon site when he selects a product. There he'll find far richer features for product recommendations, viewing history, Wish Lists, and more, as well as Similar Items selected from all Amazon offerings, not just a list of 10. I don't quite grasp the goal of trying to replicate a vastly weakened Amazon experience within the local site, when the site builder's selfish objective is to maximize the chance of actual purchase (with Associate ID attached). Then again, I may be completely missing the point.

Is the above it for Amazon Store in its current state? What else should I be doing with this module?

Testing the Amazon filter

The Amazon module offers the option to enable an Amazon filter for your favorite input format, at admin/settings/filters/. Let's take that out for a spin. My input format info shows me how to write text for the filter:

Link to Amazon products with: *amazon product_id inline|full|thumbnail*. Example: *amazon 1590597559 thumbnail*

... except that those are actually square brackets, not asterisks. I had to make that change in order to write the above, or else the filter acts on that text and inserts stuff. Powerful hoodoo!

Option 1: inline

All right. Let's try the book with ISBN 0470410876, and input *amazon 0470410876 inline* into body text below this sentence, with rich text editor turned off and square brackets in place of asterisks:

[amazon 0470410876 inline]

All right, a nice link to the book. Handy enough. The link takes the user directly to

Option 2: full

Next, the "full" argument:

[amazon 0470410876 full]

Voilá, a link along with a tiny image. For better or worse, the link is to an onsite page in the Amazon Store product format, not to I don't know why the behavior differs from the inline option, or how one could force both options to use the same behavior. 

This book isn't one of the 10 default links in my sample Store, so the Amazon filter appears to offer one way of expanding onsite Store offerings beyond 10.

Hmm, what'll happen with this "full" filter option if I disable the Amazon Store module? Wait here while I check...

No surprise: The link changes from an onsite Amazon Store page link to an product link, just as with the "inline" option. So that's the way to force links with the "full" option, though it'd be nice if there were a choice to do so while still keeping the Amazon Store module enabled.

Option 3: thumbnail

Finally, the "thumbnail" argument:

[amazon 0470410876 thumbnail]

Hm? Just an image, with no link or anything else. Not so useful, but if you need it, there it is.

Text handling

In summary, the Amazon module's Amazon filter function is a simple aid for quickly dropping a product or two into text. As you can see here, text wraps around the images it inserts; if you want text to break and resume again under the image, I imagine some CSS hacking will be in order. 

(Incidentally, for any newbies wondering: Unlike HTML code, you don't need to insert the above filter code into the text with rich text editor turned off. If you're using TinyMCE or some such, just go ahead and drop the filter code into your normal WYSIWYG text. It'll look funny there during edits, but Drupal will take care of things upon rendering the page.) 

That wraps up the Amazon filter for me. Any other neat tricks for the filter that I should be checking out? Let's hear what you've got.

Miscellaneous question for you

Stepping away from modules for the moment, here's a really basic question about the Amazon Associate program, which I hope someone experienced can answer. Say a user jumps to via a product's Associate link on your site. Whether the user decides to buy that product (say, a book) in the end or not, he goes on to view and purchase several other items (say, shoes, toothbrushes, and other books), completely unrelated to the initial product. Are you eligible for Associate earnings on all his purchases during the session that started via your link? Or are you in line for earnings only for a sale of the book that you linked to?

More to come!

I still haven't played with CCK Amazon fields; come back soon. (Or subscribe to Drupal Ace by RSS feed; then you don't have to worry about coming back.)


Stephen Winters's picture

A little clarification on the Drupal Amazon Store. When you enable the Amazon store, if you chose the "SearchIndex" (as I did) instead of the "list of Amazon ASINs" (limited to 10), your Amazon store then contains ALL of the books and other merchandise available on It's as though your visitor is actually on The Drupal Amazon search function contains just about all the functionality of actually doing a search for any type of product on Amazon. I think that this is a great feature.

Now about the Amazon browsenode. Information on it can be found here: , all it is a little confusion. It seems that using the browsenodes you can limit your Drupal Amazon store to a specific type of products or topics.

About the "list of Amazon ASINs", I also was disappointed that it only allowed you to input 10 items. I'd like to fill my Amazon store entirely with items of my choosing. I think that this is a serious lack of the Amazon store module. With that said, I think that I can still accomplish filling my Amazon store with items of my choice by using the "Views" module with the Amazon/Amazon Store modules. It just takes a little more work.


drupalace's picture

Thanks for the added notes! Some time in the coming week I'll take a close look at those items, as well as peek at the new online documentation for the Amazon module, and report back here.

Brent W. Hopkins's picture

I'm still a bit confused... what's the verdict? Is the aStore better, or the Amazon store module? Or can you use both?

drupalace's picture

Thanks for the good question! Unfortunately, I'm not too experienced with aStores, but I've answered as best as I can at Integrating Amazon astore with Drupal.

Unknown Drupaloid's picture

I dont know how to get all ASIN code from amazon website using funtion or api?

Add new comment