Amazon associate IDs are valid only for a specific locale (see #891920: Associate IDs are per Amazon locale). Both to avoid handling errors and to allow for multi-locale-setups, they should be entered and stored on a per-locale-basis.
Also, in order to have the Drupal Association receive commissions we need their respective associate IDs for each Amazon locale.

Comments

pancho’s picture

This patch should cover the major part of the task.
Remaining issues:
- We need to ask the Drupal Association to create Amazon associate IDs for each locale besides amazon.com
- Javascript needed to make the Associate ID fieldgroup immediately reflect the chosen locale
Please test and review.

pancho’s picture

Status: Active » Needs review
rfay’s picture

Status: Needs review » Needs work

This looks OK to me, although I don't like the increased complexity. Probably necessary.

Note that Amazon Store will have to take advantage of this.

I'm going to put in "Needs work" because I know you're coming back to this for another round.

Anonymous’s picture

Sub; I would like to see this functionality.

Actually, I would like to have my sites take the user to the appropriate amazon.TLD depending on where the user is. I took a quick look at the patch and wasn't sure that is the supported behavior. If not, maybe it could be extended to do that (or maybe I should file a separate feature request issue!).

Anonymous’s picture

Ah, hmm, looks like that is #396554: Allow dynamic amazon locale choice. But it seems like that needs the functionality here!

Shadlington’s picture

Has this progressed at all over the past few months?

rfay’s picture

Shouldn't be too hard to get farther along with this. Your review will help. And if you want to ask the DA to get a couple of new associate ids....

willvincent’s picture

Assigned: pancho » Unassigned
willvincent’s picture

Status: Needs work » Fixed
StatusFileSize
new26.88 KB

I've commit this.

Aside from storing multiple locale specific associate IDs, it doesn't really change much functionally just yet. However, it includes a list of product groups that are available for each locale, this will allow for configuring an instance of the asin field using autocomplete to limit results to a specific product group in a particular locale. Quite a bit more work to done on that front, but this portion fulfills the request this particular issue is about.

funature’s picture

After updating to the newest dev version which has this patch, I changed the field widget to "product name autocomplete", the widget works, but the field will not be displayed except using "ASIN as plain text" formatter.

Error retrieving Amazon item AWS.MissingParameters, message: Your request is missing required parameters. Required parameters include AssociateTag..
willvincent’s picture

Did you run update.php?

funature’s picture

yes, i did. I will try to install it again, i hope it is not related to other module.

willvincent’s picture

what other module? Amazon Store? Latest dev of this has _not_ been tested with amazon store.

funature’s picture

i did a new install today, the formatter is working. I created an ASIN field and set the amazon locale to Germany, but the link is with the tag of US but not Germany. Anyone has the same problem?

willvincent’s picture

Status: Fixed » Needs work

Hmm there is probably more to look at for this

P.Smith’s picture

It would be nice to take this a step further and allow the use of a geo plugin so that the Amazon ID relating to the visitor's country is selected (or the default one used). For now I'm looking at making a JavaScript solution to change US to the UK for my UK visitors (it's a site catering to both, albeit UK visitors make up the highest %).

  • willvincent committed 8cc4b0f on 7.x-2.x
    Issue #1083892 by willvincent: Support multiple locale associate IDs.
    
marcelovani’s picture

Issue summary: View changes

Locale support works, but there is some work needed to fix the storage, see https://www.drupal.org/node/2920070

marcelovani’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.