Skip to content

Commit 1236be1

Browse files
author
Marc Littlemore
committed
Update README
1 parent 9036b0c commit 1236be1

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

AmazonAPI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function SetRetrieveAsArray( $retrieveArray = true )
120120
* Sets the locale for the endpoints
121121
*
122122
* @param locale Set to a valid AWS locale - see link below.
123-
* @link http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/Locales.html
123+
* @link http://docs.aws.amazon.com/AWSECommerceService/latest/DG/Locales.html
124124
*
125125
* @return None
126126
*/

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,43 @@ $amazonAPI = new AmazonAPI($keyId, $secretKey, $associateId);
5050

5151
**Note:** Keep your Amazon keys safe. Either use environment variables or include from a file that you don't check into GitHub.
5252

53-
It supports all Amazon regions:
53+
### Locale
5454

55+
This library supports all [Product Advertising API locales](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/Locales.html) and you can set them using `SetLocale`:
56+
57+
It defaults to US but to set the locale call `SetLocale()` __before__ calling the product methods. E.g.
58+
59+
```php
60+
$amazonAPI->SetLocale('uk');
61+
```
62+
63+
At this time, these are the current supported locales:
64+
65+
* Brazil ('br')
5566
* Canada ('ca')
5667
* China ('cn')
57-
* Germany ('de')
58-
* Spain ('es')
5968
* France ('fr')
69+
* Germany ('de')
70+
* India ('in')
6071
* Italy ('it')
6172
* Japan ('jp')
73+
* Mexico ('mx')
74+
* Spain ('es')
6275
* United Kingdom ('uk')
63-
* United States ('us').
76+
* United States ('us')
6477

65-
The default is UK but to set the locale call `SetLocale()` __before__ calling the product methods. E.g.
66-
67-
```php
68-
$amazonAPI->SetLocale('us');
69-
```
78+
### SSL
7079

7180
By default it will use HTTPS, but if you don't want to use SSL then call the following before using the product methods and it will connect to the HTTP endpoints:
7281

73-
```
82+
```php
7483
$amazonAPI->SetSSL(false);
7584
```
7685

77-
**Note:** I have no idea why I originally had this method. Perhaps the Amazon Product API didn't use SSL at one point. I've enabled HTTPS as default now but you can turn it off if you need to. I assume you won't.
86+
**Note:** I have no idea why I originally had this method. Perhaps the Amazon Product API didn't use SSL at one point. I've enabled HTTPS as default now but you can turn it off if you need to. I assume you won't need to but I've left it in the API.
7887

7988
### Item Search
80-
To search for an item use the ItemSearch method:
89+
To search for an item use the `ItemSearch()` method:
8190

8291
```php
8392
// Search for harry potter items in all categories
@@ -89,7 +98,7 @@ $items = $amazonAPI->ItemSearch('harry potter', 'Books');
8998

9099
#### Default sort
91100

92-
By default, the `ItemSearch` method will search by featured. If you want to sort by another category then pass a 3rd parameter with the name of the category you wish to sort by. These differ by category type but the two you'll probably need are `price` (sort by price low to high) or `-price` (sort by price high to low). See [ItemSearch Sort Values](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/APPNDX_SortValuesArticle.html) for more details.
101+
By default, the `ItemSearch()` method will search by featured. If you want to sort by another category then pass a 3rd parameter with the name of the category you wish to sort by. These differ by category type but the two you'll probably need are `price` (sort by price low to high) or `-price` (sort by price high to low). See [ItemSearch Sort Values](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/APPNDX_SortValuesArticle.html) for more details.
93102

94103
```php
95104
// Search for harry potter items in Books category, sort by low to high
@@ -107,7 +116,7 @@ $searchCategories = $amazonAPI->GetValidSearchNames();
107116
```
108117

109118
### Item Lookup
110-
To look up product using the product ASIN number use ItemLookup:
119+
To look up product using the product ASIN number use `ItemLookup()`:
111120

112121
```php
113122
// Retrieve specific item by id
@@ -118,7 +127,7 @@ $asinIds = array('B003U6I396', 'B003U6I397', 'B003U6I398');
118127
$items = $amazonAPI->ItemLookUp($asinIds);
119128
```
120129

121-
## Returned data
130+
### Returned data
122131
By default the data will be returned as SimpleXML nodes. However if you call `SetRetrieveAsArray()` then a simplified array of items will be returned. For example:
123132

124133
```php

0 commit comments

Comments
 (0)