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.

Installation
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:

[php]
$aw_dev_token=”; //Get this from http://www.amazon.com/gp/aws/landing.html.
$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.
[/php]

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

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

  3. 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!

    Cheers,

    J-M

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

  5. 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?????

    cheers,
    Arjan

  6. 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?

  7. [...] •せます。定義の数は理論上は無限です。 Amazonウィッシュリスト(AmazonWishlist)ウィッシュリストIDを与えることによって、サイドバーにAmazon [...]

  8. How do I go about specifying the styles of all the div ids you laid out?
    I’m really new to CSS and PHP, and I’m confused about which where I’m supposed to tweak the selector rules.

    Also, is there a way to post the wishlist other than immediately below the Categories?

  9. I’m not sure what you mean by using it like a shopping cart. It’s just a link out to the book that happens to display. You can include an affiliate id in the URL so that anybody who clicks through and buys a book will wind up giving you a credit, but that’s about it.

  10. Idea is to keep the visitors in your site as much as posible, only when they are ready to buy will go to amazon. Ex: in one site ExtraMovie I use a direct link to add the product to the shopping cart (Amazon shopping cart). On the other site BooksEnthusiast I have a remote shopping cart. You may want to try to see the difference! Your wishlist is like in Extramovie example or BooksEnthusiast example ?

  11. Our purposes are different. Yours is to make money selling books. Mine is to entice people to purchase an item on my wish list, or at any rate, to allow people to see what sorts of books I like. It doesn’t really make sense to write a WordPress bookstore plugin, as that’s not what WordPress is for.

  12. I notice that the plugin is only pulling random books from the ten most recent on my list. Is there any way to change this so that it pulls them from the list overall?

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Connecting to %s