amazon.com/onca/xml?Service=AWSECommerceService
&Operation=ItemSearch
&AWSAccessKeyId=[Your Access Key ID]
&Keywords=postal+t-shirt
&SearchIndex=Apparel
&ResponseGroup=Request%2CMedium%2CVariationSummary&Sort=salesrank
From all the products that will be returned by our request, we will display only the ones
that are available for purchase and with cover images.
CHAPTER 22 ?– USING AMAZON.COM WEB SERVICES 676
Implementing the Business Tier
In the business tier, you??™ll add the code that accesses the A2S system.
Exercise: Adding A2S Communication Code to the Business Tier
1. Add the following code in your include/config.php file:
// Amazon E-Commerce Service
// define('AMAZON_METHOD', 'REST');
define('AMAZON_METHOD', 'SOAP');
define('AMAZON_WSDL',
'http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl');
define('AMAZON_REST_BASE_URL',
'http://webservices.amazon.com/onca/xml?Service=AWSECommerceService');
// Set Amazon Access Key ID
define('AMAZON_ACCESS_KEY_ID', '[Your Access Key ID]');
// Set Amazon Associates ID
define('AMAZON_ASSOCIATES_ID', '[Your Amazon associate ID]');
// Set Amazon request options
define('AMAZON_SEARCH_KEYWORDS', 'postal t-shirt');
define('AMAZON_SEARCH_NODE', 'Apparel');
define('AMAZON_RESPONSE_GROUPS', 'Request,Medium,VariationSummary');
2. Create a new file named amazon.php in the business folder, and add the following code to it.
Pages:
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791