You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-15Lines changed: 24 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,34 +50,43 @@ $amazonAPI = new AmazonAPI($keyId, $secretKey, $associateId);
50
50
51
51
**Note:** Keep your Amazon keys safe. Either use environment variables or include from a file that you don't check into GitHub.
52
52
53
-
It supports all Amazon regions:
53
+
### Locale
54
54
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')
55
66
* Canada ('ca')
56
67
* China ('cn')
57
-
* Germany ('de')
58
-
* Spain ('es')
59
68
* France ('fr')
69
+
* Germany ('de')
70
+
* India ('in')
60
71
* Italy ('it')
61
72
* Japan ('jp')
73
+
* Mexico ('mx')
74
+
* Spain ('es')
62
75
* United Kingdom ('uk')
63
-
* United States ('us').
76
+
* United States ('us')
64
77
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
70
79
71
80
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:
72
81
73
-
```
82
+
```php
74
83
$amazonAPI->SetSSL(false);
75
84
```
76
85
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.
78
87
79
88
### Item Search
80
-
To search for an item use the ItemSearch method:
89
+
To search for an item use the `ItemSearch()` method:
81
90
82
91
```php
83
92
// Search for harry potter items in all categories
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.
93
102
94
103
```php
95
104
// Search for harry potter items in Books category, sort by low to high
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:
0 commit comments