Amazon Wishlist

Another Update (Sept. 3, 2004): I’ve added a category for the amazon plugin that’ll list all relevant posts so I don’t have to keep going back and adding these stupid updates. Be sure to read all posts in the category for complete details.

Update (Aug. 16, 2004): I’ve added some functionality and fixed a bug. Check here for details.

I’ve just written my first WordPress plugin. Actually, I had previously modified the acronym plugin to allow me to specify some common words that should always be associated with links (only later did I notice that the author of the original plugin had already done just this). Amazon Wishlist is my first original plugin, though, and even at that, the bulk of the code isn’t mine. I found a fairly concise script that interfaces with the Amazon API and another that actually handles making the connection, and I wrapped some code around the results to make it all into a nice configurable plugin for WordPress. Incidentally, there is another Amazon plugin here that allows you very easily to browse books and insert them into your entries. Very nifty, but it serves a different purpose.

You have only to download the plugin, stick it in your wp-content/plugins directory, edit a few variables, optionally add some style sheet definitions, and activate the plugin using your control panel. Straight from the code itself:

$aw_dev_token=”; //Get this from
$aw_associates_id=”; //Optional; set to empty string if not applicable.
$aw_type=’lite’; //could also be heavy, though it doesn’t seem to make a difference in the search results.
$aw_wishlist_id=”; //The id of the wish list you wish to search. Hint: Search for (don’t simply go to) your wish list and copy the id from the end of the URL.

$aw_header=’Amazon Wish List’; //Used to label the box.
$aw_show_author = 1; //Set to 0 to suppress.
$aw_image_size = ‘Medium’; //’Small,’ ‘Medium,’ or ‘Large’
$aw_show_price = 1; //Set to 0 to suppress.

Here’s hoping it’s not buggy and that it helps somebody out. You can see it in action in my sidebar.

31 thoughts on “Amazon Wishlist

  1. Tin says:

    hi, does this plugin work only for books or can i use it for any item on amazon? (cameras, printers, etc). thanks!

  2. WordPress Amazon Wishlist Plugin
    Daryl L. L. Houston has released a revision to his Amazon Wishlist plugin for WordPress. In looking at the XHTML generated by the plugin, I was a bit dissatisfied, so I’m going to modify it a bit—which I can do, since the plugin was released under …

  3. In order to use Amazon’s API, you have to have a developer token. Presumably, this is in large part so that they can make sure you’re not abusing their system, though they no doubt use the token to track you for other reasons as well. You can apply for a developer token at the URL noted in the comment on the line in question. It’s just a matter of providing some contact information. Amazon will send you a string of characters in response. This is your developer token and is what you should place between the quotes in the line in question. I don’t provide my own developer token as part of the plugin because I don’t want to be at risk of having it revoked thanks to abuse on the part of others.

  4. Hello,
    WHen using $aw_show_after_cats = 1, the amazon wish list gets stuck in the category loop, displaying itself under each category. That gives a quite ugly mess, I would advice you to have a look at it if you have some time!



  5. Comment No. 19, I’m unable to duplicate this behavior. When I set the flag to 1 and don’t remove the function call to “get_amazon_wishlist()” from within my template, I do get one duplicate listing (that is, the Amazon block displays twice), but this is expected behavior. It sounds like what may be happening is you’ve put that function call inside a loop that generates categories. In any case, I’m unable to duplicate this with the information provided. Thanks for reporting it, though.

  6. Very nice plugin… We use the plugin to inspire people reading books from our wishlist… but to make it even more inspirational we would like to show the cover in stead of the title… ANY CLUES HOW TO DO THAT?????


  7. I am setting up my site in preparation of migration from Blogger and I am thinking of implementing the Amazon Wishlist plugin. It is working well on the webpage, but when it is running, I get an error on the admin page:

    Fatal error: Cannot redeclare class snoopy in /home/thebloke/public_html/wp-includes/class-snoopy.php on line 40

    I was told to remove the Snoopy section out of the plugin, and when I do, I get an error message where Amazon wishlist is supposed to be, but the dashboard works.

    Can you please help?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s