How to use Amazon Module

Last edited on Sat, 2012-07-07 23:19
Amazon Node example

On Drupal, there is a module to get and display products info by using Amazon API. This site uses Amazon module when describe Amazon products such as CDs, Books.

About Amazon module, this is a detail document.

Using Amazon module, You can write a page like 'Using Drupal'. This site uses Fivestar module with Amazon module for rating of products.


First, install each module. Fivestar module needs Voting API module.

All components of Amazon module are enabled. Fivestar and Voting API of Fivestar module are enabled.

Settings such as Amazon API, etc.

Next seettings of Amazon API, etc. Go to 'Site Configuration' -> 'Amazon API', set Locale, API Key and Associate ID, etc. For Fivestar, 'Site Configuration' -> 'Fivestar', set Widget Display. I use Default. There are hearts, flames, etc. add to stars. You can set widget display by content types.

Add new content type

Add new content type for Amazon product review, named Amazon Node for example. Add two fields to new content type. One is for Amazon product ID (ASIN), Another is field for rating. Field type is Amazon Item and Fivestar Rating, respectively.

Next, settings of fields. For Amazon Item, check 'required', and 1 for 'number of values'. For Fivestar Rating, check 'required', 5 for 'number of stars', voting target is 'none'.

On display fields tab, I set label 'Hidden', Teaser and Full Node 'small image and basic info', but you can change as you like. For rating, Label is 'inline' and Teaser and Full Node are 'as stars'.

Create Amazon Node

Finally, create Amazon Node content. Amazon Item <div> block and Rating <div> block are inserted before text. A position is able to change using CSS. Edit screen is here.

amazon edit screen

When you want to display 'inline' (not at head of text), you can use Amazon filter. If you write macro in a text, Amazon product info is inserted at that position of text. You need Amazon filter enabled on your input format.