It would be wonderful to have the option to select multiple countries with different associate ID's for use in this module. Using myself as an example, I have an associate ID from amazon.ca (since I'm from Canada) and also one from amazon.com (since most of my traffic comes from the US), and I would like users to be able to use their own store. Something like having a main store and then having country codes which link to the appropriate Amazon store (with the related associate ID embedded) would be useful to me.
My PHP and MySQL isn't very strong, otherwise I'd try to add this functionality myself. But if it would be useful to others (and I think it would), then I'd appreciate if you'd consider trying to add this functionality! Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | multiple_amazon_associates.jpg | 13.52 KB | BradM |
| #5 | amazon-node-contemplate-file.txt | 2.13 KB | techczech |
Comments
Comment #1
Prometheus6 commentedThat's not something I would do for free. Not even Amazon.com runs their stores from a single database or software installation.
Comment #2
llyra commentedI also have multiple Amazon associate accounts due to different countries (one account with US and one with UK). Just letting you know that there may be a need for this type of option for this mod.
Comment #3
mariuss commentedSame here, adding multiple Amazon Associate IDs would be great. Each book can then be listed several times (the image/title/author probably only once), once for each country there is an associate ID.
Also, users could select which country they prefer and then only links for that country will show, or the other links are collapsed.
Comment #4
techczech commentedjust would like to add my vote in support of these suggestions - you say it's not something you'd do for free - maybe a bunch of us users could chip in on this feature - if you have established development rates
Comment #5
techczech commentedI solved this problem at the theme level thanks to the fact that Amazon uses a unified ASIN-based link structure over their sites. I got the nodes from the US site simply because it typically has the best editorial reviews and then used Contemplate (just for ease of modification) to create links to all Amazon countries (even those where I don't have associate accounts. So far, even the more obscure publications were found on all of them. Here's the theme code for the links:
I enclose my complete theme file if anyone's interested that themes the whole Amazon Node.
Comment #6
techczech commentedBTW: You can see the files above at work for example at http://www.conceptualmetaphor.net/metaphorbookstore.
Comment #7
solipsist commentedNice work bohemicus, and a nice site too! Always cool to see cog sci sites! I think I'll do that same for my own fantasy author focused site!
Comment #8
csc4 commentedI put the amazon-node-contemplate-file.txt code into the contemplate node template but it doesn't seem to be picking up the variables - is there something else I need to do?
Comment #9
cpelham commentedThat's super...but what if a book is available only on one of the foreign amazon stores and not on amazon.com? At present, if I try to make a new node for a foreign-language edition, for example, whose ASIN is listed on amazon.co.jp but not on amazon.com, then drupal will not make the node.
I am trying to make a node for ASIN 4309230784 for the Japanese-language edition of Disappearance of the Universe (in case anyone else wants to give it a try), and I get the error:
No product: %asin exists at Amazon.com
Is there away around this? Perhaps I can just modify the lookup code, wherever it is, to try another store if it does not find the asin in the amazon.com store. I'm not sure where in the module that code is, but I'll take a look...has anyone else already done this?
Comment #10
Riccardo83 commentedsorry, dumm question. where can i change that node template ?
amazon-node-contemplate-file.txt ????
Comment #11
techczech commentedYou need to install the contemplate module and then follow the instructions. You could also create a .tpl.php file with that code.
re 9: I noticed that it always picks up the ASIN from the .com bookstore in the non.com stores. No idea what happens the other way around. It may be beyond the capabilities of this simple workaround.
Comment #12
Riccardo83 commentedthank you so much. did anyone figure out how to add those patches since the module was updated and the patches dont work?
http://drupal.org/node/151637
Or could anyone help me?
Comment #13
BradM commentedSeeing as this module isn't being updated, I have on occasion hacked the source code rather than fiddle with themes or other areas ... a cardinal sin, to be sure, but what the heck. ;)
Anyway, I've implemented a similar thing as outlined by bohemicus, except my version requires modification of the amazon.module file, so only do this if you feel comfortable in doing it... and only if you've made a backup! This version will display flags underneath the price listing when viewing an amazon node (US-based associate). These additional product links are for amazon.co.uk and amazon.ca -- see the attached screen shot for details.
Around line 1488 in amazon.module, you should see something like this:
Replace that code above with the following:
Things you need to know:
Well I hope this all makes sense; I'm no expert coder but I might be able to answer your questions.
Brad
Comment #14
wayland76 commentedIf the issue http://drupal.org/node/221525 ever gets implemented, it might be possible to use this code without hardcoding the associate ID in the code.
Comment #15
wayland76 commentedComment #16
joel_guesclin commentedI'm trying to do something like this using ASIN CCK fields. I posted an issue for the ASIN module on this very topic - and was wondering if it were possible to integrate this patch with the ASIN module, and if so how? Any help would be very welcome.