Class: AmazonQuery
Source Location: /aq.php
The AmazonQuery class is the software's main class.
Author(s):
Version: 0.3
Copyright: 2004 (c) Mauricio Diaz Orlich
|
|
Class Details [line 62]
Class Methods
constructor AmazonQuery [line 75]
method addToCart [line 1122]
ShoppingCart addToCart(
array
$items, [string
$locale = "us"], [string
$cartID = ""], [string
$HMAC = ""], [boolean
$similar = true])
|
|
Add an item, or a list of items to an existing manual.cart.pkg. This function is used to add items to an existing Remote Shopping Cart. To create a new shopping cart take a look at newCart(). If you do not provide the $cartID and $HMAC parameters, or if these are equal to a blank string, this function behaves exactly like newCart(). Example: - $items = array();
- $items[] = array("B00005JMEW", 1);
- $items[] = array("1932273271", 2);
-
- $cart = $aq->addToCart($items, "us", $_SESSION['cartID'], $_SESSION['HMAC']);
Tags:
Parameters:
method clearCart [line 1268]
method getBrowseNode [line 165]
ProductInfo getBrowseNode(
integer
$bn, string
$mode, [string
$locale = "us"], [string
$type = "lite"], [integer
$page = 1], [string
$sort = "Bestselling"])
|
|
Queries an AWS Browse Node, that has not been specified as an amazOOP category for all its products.
Tags:
Parameters:
method getCart [line 1245]
ShoppingCart getCart(
string
$cartID, string
$HMAC, [string
$locale = "us"], [boolean
$similar = true])
|
|
Retrieve the contents of an existing manual.cart.pkg. This function is used to retrieve an existing Remote Shopping Cart. Note that every other action (new, add, modify, remove and clear) will also return the contents from the cart, therefore you only need to use this function if you want to retrieve a cart without mofifying it. Example: - $cart = $aq->getCart($_COOKIE['cartID'], $_COOKIE['HMAC'], "de");
Tags:
Parameters:
method getCategory [line 121]
ProductInfo getCategory(
[string
$category = "books"], [string
$locale = "us"], [string
$type = "lite"], [integer
$page = 1], [string
$sort = "Bestselling"])
|
|
Queries an amazOOP category for all its products. Example: - $books = $aq->getCategory("books", "uk");
-
- for($i = 1; $book = $books->getDetails($i); $i++){
- echo $book->getProductName() . "<br>";
-
- echo $book->getAuthors(2) . "<br>";
- }
Tags:
Parameters:
method heavyQuery [line 469]
mixed heavyQuery(
string
$keywords, string
$searchType, [string
$mode = "books"], [string
$locale = "us"], [integer
$page = 1], [string
$sort = "Bestselling"])
|
|
Makes a "heavy" request to AWS. Products obtained from a heavy request are stored in objects of type HeavyDetails, and can contain all the attributes defined in this kind of objects, athough this is not necessarily the case. Although this function can return ProductInfo or BlendedSearch objects based on the kind of search you are doing, these objects will only contain HeavyDetails objects, and in no case LiteDetails objects.
Tags:
Parameters:
method liteQuery [line 413]
mixed liteQuery(
string
$keywords, string
$searchType, [string
$mode = "books"], [string
$locale = "us"], [integer
$page = 1], [string
$sort = "Bestselling"])
|
|
Makes a "lite" request to AWS. Products obtained from a lite request are stored in objects of type LiteDetails, and can contain all the attributes defined in this kind of objects, athough this is not necessarily the case. Although this function can return ProductInfo or BlendedSearch objects based on the kind of search you are doing, these objects will only contain LiteDetails objects, and in no case HeavyDetails objects.
Tags:
Parameters:
method modifyCart [line 1169]
ShoppingCart modifyCart(
array
$items, [string
$locale = "us"], [string
$cartID = ""], [string
$HMAC = ""], [boolean
$similar = true])
|
|
Modifies the quantities of items in an existing manual.cart.pkg. This function is used to modify the quantities of items you have already added to a Remote Shopping Cart. To create a add new items to a cart take a look at addToCart(). You must provide an array of items to be modified. This array must contain Item IDs of products already in the shopping cart, associated with their new quantities. Example: - $noOfModItems = $_POST['noOfItems'];
- $items = array();
-
- for($i = 0; $i < $noOfModItems; $i++)
- $items[] = array($_POST['itemID'.$i], $_POST['qty'.$i]);
-
- $cart = $aq->modifyCart($items, "us", $_POST['cartID'], $_POST['HMAC']);
Tags:
Parameters:
method newCart [line 1077]
ShoppingCart newCart(
array
$items, [string
$locale = "us"], [boolean
$similar = true])
|
|
Add an item, or a list of items to an new manual.cart.pkg. This function is used to add items to an new Remote Shopping Cart. To add items to an existing shopping cart take a look at addToCart(). You must recover the new cart's ID and HMAC by using methods getCartID() and getHMAC(), in order to modify it using functions addToCart(), modifyCart, removeFromCart(), clearCart() and getCart(). Example: - $items = array();
- $items[] = array("B00005JMEW", 1);
- $items[] = array("1932273271", 2);
-
- $cart = $aq->newCart($items, "jp");
Tags:
Parameters:
method query [line 222]
mixed query(
string
$keywords, string
$searchType, [string
$mode = "books"], [string
$locale = "us"], [string
$type = "lite"], [integer
$page = 1], [string
$sort = "Bestselling"])
|
|
Queries AWS as instructed. This is the "low-level" method used to query AWS. Methods such as getCategory(), getBrowseNode(), liteQuery(), or heavyQuery(), all call this method. As a matter of fact, you should rather use one of the aforementioned methods unless you feel quite confortable with amazOOP.
Tags:
Parameters:
method queryRemoteShoppingCart [line 952]
ShoppingCart queryRemoteShoppingCart(
[string
$action = "get"], [array
$items = ""], [string
$locale = "us"], [string
$cartID = ""], [string
$HMAC = ""], [boolean
$similar = true])
|
|
A variant of query() used specifically to query a Remote Shopping Cart. Like query(), this is a "low-level" function, therefore most users will prefer to use the Remote Shopping Cart with newCart(), addToCart(), modifyCart, removeFromCart(), clearCart() and getCart().
Tags:
Parameters:
method removeFromCart [line 1210]
ShoppingCart removeFromCart(
array
$items, [string
$locale = "us"], [string
$cartID = ""], [string
$HMAC = ""], [boolean
$similar = true])
|
|
Removes items from an existing manual.cart.pkg. You must provide an array of items to be removed. This array must contain Item IDs of the products you wish to remove from the shopping cart. Example: - $items = array();
-
- for($i = 0; $i < $_POST['noOfItems']; $i++)
- $items[] = $_POST['itemID'.$i];
-
- $cart = $aq->removeFromCart($items, "us", $_POST['cartID'], $_POST['HMAC']);
Tags:
Parameters:
method rssFeed [line 497]
string rssFeed(
string
$browseNode, [string
$mode = "books"], [string
$locale = "us"], [mixed
$page = 1])
|
|
Generates an RSS 2.0 feed for a Browse Node from Amazon. You should read the tutorial WARNING!!! This is an experimental feature. Use it, tweak it, and send feedback!!!
Tags:
Parameters:
|
|