Home

Primary links

  • top o the deck
  • Drupal for Beginners
  • about
  • links
  • give me some sugar

Drupal stuff

  • EDAM
  • STARDOM
  • Question Bank
  • Drupal musings
  • Drupal tips
Home Blogs Drupalace's blog

Key stuff on this site

Easy Drupal Admin Manual (EDAM)

SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)

Drupal for Beginners

Subscribe to posts by RSS or email

Subscribe to Drupal Ace by RSS feed RSS feed 

Subscribe to Drupal Ace by Email

Donate towards my web hosting bill! Get a great host!

Share and save

Share/Save

Random piece of content

Maintenance and Construction Notices

Manuals on this site

  • Easy Drupal Admin Manual (EDAM)
    • Welcome to Your Site
    • First Steps: Please Read!
      • Understanding These Instructions
      • Important Terminology!
      • Best Practices for Site Admins
    • Super Quick Guide (for the experienced and the brave)
    • Logging In
    • Your Administrator Tools
    • Setting Site Basics
      • Setting Site Information
      • Configuring Your Theme
    • Creating Content
      • Node Types
      • Create a Page Node
      • Create a Story Node
      • Create a Blog Entry Node
      • Making Images and Other Files Available
      • Using Text and Image Editors
    • Organizing Your Content
      • Terms, Vocabularies, and Taxonomy: "Tagging" Your Content
        • Taxonomy Suggestions
      • Menus, Links, and Paths: Navigating the Site
        • Content Paths and URLs
        • Creating Links
        • Working with Menus: Administration Form (Drupal 6)
        • Working with Menus: Administration Form (Drupal 5)
        • Creating Menu Items on the Fly
        • Placing Menus on Your Pages
      • Placing Content on pages
        • Creating a page from a Single Node
        • Creating a page from a List of Nodes
        • Setting the Front Page
      • Working with Blocks
    • Maintenance Stuff
      • Maintenance and Construction Notices
    • Other Fun Things
      • Changing Color of Garland Theme
      • Free Aliases!
  • SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)
    • Set a Clear Goal
    • Make a Good Site
      • Put out the Welcome Mat
      • Make Great Content
      • Build a Great Brand
      • Make Navigation Easy
      • Tune Site Performance
    • Drive Traffic
      • Promote your Site
      • Get Found with SEO
    • Build a Community
      • Build an Offsite Community
    • Monitor and Improve
    • One-Page Checklist
    • Drupal and the Blogging Starter Checklist
      • Drupal and the Blogging Starter Checklist, Part 1
      • Drupal and the Blogging Starter Checklist, Part 2
      • Drupal and the Blogging Starter Checklist, Part 3
      • Drupal and the Blogging Starter Checklist, Part 4
      • Drupal and the Blogging Starter Checklist, Part 5
      • Drupal and the Blogging Starter Checklist, Part 6
      • Drupal and the Blogging Starter Checklist, Part 7

Recent comments

  • Deleting cookies

    Good point; thanks! Deleting cookies and/or caches, depending on the problem at hand, is a part...

  • It worked

    adding $GLOBALS['tempUser'] = $user; worked but I find it worth noting that I had to delete...

  • very good document...

    very good documentation for beginners!!!!!! thanks!!

  • del penitential 62

    strike out abject
    eliminate penitent 5

  • Chat

    Thank you a lot about very beneficial to my work was very useful thank you

more

Checking out Amazon on Drupal 6, Part 1

Submitted by Drupalace on Tue, 2009-09-29 02:30
  • ecommerce
  • modules
Amazonmouth.jpg

How can you easily add Amazon product links to a Drupal site? If you've been working with Drupal at all, you can guess the answer: There's a module for that!

That would be the Amazon module. Yet... How do you use that module? As noted in this forum thread, the module contains nearly no documentation, and I failed to find anything among the Drupal.org handbooks. 

There's a little documentation on Drupal.org for the Amazon Store module but not for the Amazon module itself. This finding is repeated inside a comment at comment at Drupal Modules.com: "It doesn't have any documentation on how to use it but I found a lot out by visiting the issue queue and reading the user posts."

I'm trying to get Amazon working on another site, just a simple way to display some Amazon offerings alongside a node, or even an in-site "store". One solution, of course, is to paste Amazon code directly into nodes or blocks, but that's somewhat static; I'm interested in seeing what a module can do to improve upon that. Some problems and in-progress solutions:

The Amazon module for Drupal 6

I experimented with the Amazon module under Drupal 5. I no longer have an operational Drupal 5 site with Amazon content to play with, but I recall (correctly?) that the module created "Amazon node" as a content type. It was like a Page or other standard content type, but populated its fields with info on an Amazon product, based on the ISBN or ASIN you input into the appropriate field. There was even a nifty interface letting you search Amazon products from within the admin page and mark specific products, which would then get imported en masse as Amazon nodes.

Here's what Amazon module 6.x-1.0-beta7 for Drupal 6 offers, according to the READ ME document:

1) A core API module that communicates with Amazon's web services and adds support for retrieving, displaying, and storing basic product information in Drupal as well as associating Amazon products with content nodes. [Views integration is still in progress, pending the completion of Views 2 for Drupal 6.]

2) A field type (and an accompanying set of formatters) for CCK that allows Amazon products to be explicitly added to any node type. [This portion of the package is still in progress, pending the completion of CCK for Drupal 6.]

3) An 'Amazon Media' module that adds support for Amazon's extended product information for several common product types (Books, Music, DVDs, and Software).

4) An 'Amazon Search' module that allows developers to conduct API-driven searches of the Amazon product database. This module also allows users to search Amazon's product database from Drupal's Advanced Search page.

Hmm. So it appears to be an API module that'll later allow other modules to handle most expected functions. The settings at admin/settings/amazon support this: there's a tab for your Amazon Associates-related information, a tab for setting a couple of product data parameters, and a tab for testing things, via a single field for a product ID. That's it. I see no mention of or interface related to Amazon nodes, or any interface for searching and marking Amazon products for import as nodes. (And as an API module, the lack of non-developer documentation isn't so unusual.) 

There's not much to play with, but let's give the "Test" tab a spin. Input a valid product ID, click "Look Up Product", and... errors result, including...

warning: Invalid argument supplied for foreach() in .../modules/amazon/amazon.module on line 292.

...which persisted even after updating to the latest module version (mine was initially a version or two behind) and running update.php.

The problem was apparently in my Settings tab. Things have changed over at Amazon since my 5.x experiments, and I won't pretend to be up to speed. First, I had my Associate ID already input, as well as a value in the Amazon AWS Access Key ID field, left over from 5.x. These had both been obtained, to the best of my memory, from my account pages at https://affiliate-program.amazon.com/ .

But for the new field Amazon AWS Secret Access Key, it seems I needed to visit the site http://aws.amazon.com/ . That's a new one on me. My Amazon Associate ID worked there, which is good, and I found my way to the Security Credentials page that provided me with the Secret Access Key.

All of which I did when checking my setup, so why the errors? In the end, my old, leftover Access Key ID was likely the troublemaker. My Security Credentials page at https://aws-portal.amazon.com displayed a new Access Key ID, paired with the Secret Access Key; with both new keys in place, the Test tab did its thing with no error (I think; see below). 

It's no surprise that the mismatched keys would generate some error, though rather than the above I would have expected some sort of "ID not verified" message. But maybe that's essentially what's happening under the hood. 

(Shifting attention from Drupal to Amazon, it's also odd that I need to get some of my info from affiliate-program.amazon.com and some from aws.amazon.com; why aren't these integrated into one? Anyone out there have insights for this confused Amazon newbie?)

Anyway, back to that test: What was the result? The test returned a page that starts out looking good, but doesn't stay that way for long:

Testing the Amazon module

(Followed by more in that vein.) 

Ahem. Is this what the test is supposed to return? Anyone know? Well, it may not be pretty, but it is information for the correct item. So far so good, I'll guess.

More soon

The above exhausts the immediate, interactive features of the Amazon module that I can see, but there's more to do, including checking out CCK Amazon fields and the Amazon Store module. I'll be back very quickly with more.

Share/Save
  • Drupalace's blog
  • Printer-friendly version
  • Quote
melwyn's picture

how did u get rid of the

Submitted by melwyn (not verified) on Wed, 2009-12-16 21:11.

how did u get rid of the above issue ... all the below info array .......

 

I cant seem to find a solution anywhere .. I tried using a set of new access keys ...but no use

  • reply
  • quote
melwyn's picture

I have the same issue as above

Submitted by melwyn (not verified) on Wed, 2009-12-16 21:08.

Please could you tell me how did you rectify the above issue. I have looked up everywhere on drupal i cant come across anyone having the above issue .

The information of the item is correct... but whats with all the array and info below ? how do i get rid of it ...

I did register for an AWS account ..did use an new set of keys but i still cant get rid of this shit ..

along with this right on the top ..in red i have this user warning: Unknown column 'invalid_asin' in 'field list'
query: INSERT INTO amazon_item (asin, title, detailpageurl, salesrank, publisher, manufacturer, studio,
label, binding, listpriceamount, listpricecurrencycode, listpriceformattedprice, productgroup, producttypename,
invalid_asin, timestamp) VALUES ('0195398610', 'Fixing Failed States: A Framework for Rebuilding a Fractured World', 'http://www.amazon.fr/Fixing-Failed-States-Framework-Rebuilding/dp/0195398610%3FSubscriptionId%3DAKIAJNODW3O3INJNDHIQ%26tag%3Dmelwyn.s@gmail.com
%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0195398610', 15082,
'Oxford University Press Inc', 'Oxford University Press Inc', 'Oxford University Press Inc', 'Oxford University
Press Inc', 'Broché', 1175, 'EUR', 'EUR 11,75', 'Book', 'ABIS_BOOK', 0, 1260964550) in
C:\wamp\www\usingdrupal\includes\common.inc on line 3468.

 

  • reply
  • quote
Drupalace's picture

Amazon errors

Submitted by Drupalace on Tue, 2009-12-22 01:26.

In my case, getting the correct Amazon account info input was, to the best of my memory, the trick that cleared up the error. In addition, the error message I was receiving appears different from yours. So my guess is your problem has its cause somewhere else...

Regarding the error message you display, is it coming from the admin/settings/amazon form's "Test" tab? Or is this being generated somewhere else?

  • reply
  • quote
Randy Fay's picture

Amazon documentation needs you

Submitted by Randy Fay (not verified) on Sun, 2009-10-18 14:36.

The Amazon module documentation is in progress, at http://drupal.org/node/595464. Your contributions are welcome!

  • reply
  • quote
Drupalace's picture

Amazon module documentation!

Submitted by Drupalace on Mon, 2009-10-19 16:55.

Hey, Amazon module documentation! I guess this is brand new, or I just missed it before under the "Commerce and advertising modules" header? Either way, excellent!

Looks like a great start. Let me read through, and I'll very happily add whatever I know that isn't in the text. Thanks!

  • reply
  • quote

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><br><p>
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options


Relevant Content

The Drupal Ace logo has dealt these content suggestions from the deck.

  • Checking out Amazon on Drupal 6, Part 2
  • Back on track with Node Import
  • How's that Ubercart review coming along?
  • Testing Ubercart ecommerce: Please help with missing tabs!
  • Coming up: Review of Packt Publishing's "Drupal E-commerce with Ubercart 2.x"
  • Manhandle that database back into shape
  • Module upgrades cause troubles

Learn Drupal, hands-on

Get the beginner-friendly ebook that teaches community site building via a live case study.

Drupal 6 Ultimate Community Site Guide

Read the review

Drupal mini tip

The Book module creates "Printer-friendly version" at the bottom of Book pages. If you hit that link from a page with child pages, Drupal creates a printer-friendly page from that page and its child pages. If you hit the link from the Book's top page, you get the whole book in a single page!

It's a deal!

Dreamhost dealsDrupal Ace presides over his domain, proudly ensconced in his DreamHost eyrie. Won't you join me?

Promo code deal!

Just enter the code 49ER when you register for an account, and save $49 off the already-low price. No strings!

Read my hosting service review

Powered by Drupal, an open source content management system

Copyright 2007 and forever after. Made with Drupal, of course. On OS X, of course. Served up by DreamHost. DreamHost

RoopleTheme