ADDING OTHER AMAZON LOCALEs to AMAZON_STORE ------------------------------------------- NOTE: This file is left here for historical reasons only, or in case someone wants to improve the existing locale support. This work has already been done. Many people have requested support for locales other than the US locale for the Amazon Store module (http://drupal.org/project/amazon_store. Here is what we have to work on to make that happen. What has to be done is to add additional Locale data members of the SearchIndexes::data protected member in searchindexes.inc. For example, the existing (US) definition starts off like this: ------------- protected $data = array( 'US' => array( 'All' => array('friendly_name' => 'All', 'BrowseNode' => 2000, 'parameters_allowed' => array('Keywords'), 'sorts' => NULL, ), 'Apparel' => array('friendly_name' => 'Apparel', 'BrowseNode' => 15683091, 'parameters_allowed' => array( 'Brand', 'BrowseNode', 'Condition', 'ItemPage', 'Keywords', 'Manufacturer', 'MaximumPrice', 'MerchantId', 'MinimumPrice', 'Sort', 'State', 'TextStream', 'Title'), 'sorts' => array( 'relevancerank' => 'Relevance', 'salesrank' => 'Bestselling', 'pricerank' => 'Price: low to high', 'inverseprice' => 'Price: high to low', '-launch-date' => 'Newest arrivals', 'sale-flag' => 'On sale', ), ), --------------- To add another locale, the first thing that has to be done is to add another element to this array. Most of the information we need to do this is at http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/APPNDX_SearchIndexParamForItemsearch.html For example, the start of our UK locale information would come from http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/UKSearchIndexParamForItemsearch.html 'UK' => array( 'Apparel' => array('friendly_name' => 'Apparel', 'BrowseNode' => 83450031, // Obtained from browsenodes.co.uk 'parameters_allowed' => array('Author', 'Availability', 'Brand', 'BrowseNode', 'Condition', 'Count', 'DeliveryMethod', 'Format', 'ISPUPostalCode', 'ItemPage', 'Keywords', 'Magazines', 'Manufacturer', 'MerchantId', 'Performer', 'PostalCode', 'Sort', 'State', 'Title'), // Sorts come from http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/APPNDX_SortValuesArticle.html 'sorts' => array( '-launch-date' => 'Launch Date', 'price' => 'Price, Low to High', '-price' => 'Price, High to Low', 'relevancerank' => 'Relevance', 'reviewrank' => 'Average customer review', 'salesrank' => 'Bestselling', ), 'Baby' => array... So this is all just hard work, or work done by a script. (I built a couple of scripts to process the documentation for some of this information, but they were not more than one-use scripts, and aren't useful for this phase.) Finding out the Browsenode for the categories for non-US, non-UK Search Indexes is something I don't know how to do. The reason for the browsenode is so that a simple list of items can be presented if the user hasn't yet entered a set of keywords. So basically what we need for an additional locale is the 500 or so lines of data structure which describe Amazon's documentation for that locale, including the Search Indexes, the BrowseNode, the Parameters that can be used, and the sorts that are available. If you give me a filled out data structure I'll try to merge it into searchindexes.inc. Thanks, -Randy