Class | Amazon::ShoppingCart |
In: |
lib/amazon/shoppingcart.rb
|
Parent: | Search::Request |
Load this library with:
require 'amazon/shoppingcart'
This class provides access to Amazon’s Remote Shopping Cart functionality.
items | [R] | |
purchase_url | [R] | |
similarities | [R] |
Returns an HTML form to allow the user to purchase an item through Amazon’s 1-ClickŪ technology.
This method presents the illusion of the shopping cart being a Hash, indexed on ASIN. Unfortunately, if the same ASIN is added to the cart more than once, it will appear multiple times. In other words, if you add 3 copies of a book to the cart and then later add another 4, there will be two entries in the cart, not one with 7 copies.
For this reason, this method returns an Array of Amazon::ShoppingCart::Item objects, one for each line item of the shopping cart that matched asin.
Add an item or items to a shopping cart. asin_list may be a String containing a single ASIN or an Array containing multiples. quantity should be greater than zero.
Empty a shopping cart. This method has an alias, empty. Note that the cart, itself, is not destroyed. You may continue to add items to it.
Modify an item or items in a shopping cart. item_list may be a String containing a single item ID (not ASIN) or an Array containing multiples. quantity should be zero or greater. Specifying zero has the effect of removing the item from the cart and is an alternative to directly calling remove_items in your code.
Remove an item or items from a shopping cart. item_list may be a String containing a single item ID (not ASIN) or an Array containing multiples. An alternative to using this method is to call modify_items with a quantity of zero.