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.

Methods

Classes and Modules

Class Amazon::ShoppingCart::CartError
Class Amazon::ShoppingCart::Item
Class Amazon::ShoppingCart::QuantityError
Class Amazon::ShoppingCart::Response

Attributes

items  [R] 
purchase_url  [R] 
similarities  [R] 

Public Class methods

Returns an HTML form to add an item to the shopping cart.

Returns an HTML form to add a Marketplace item to the shopping cart.

Returns an HTML form to allow the user to purchase an item through Amazon’s 1-ClickŪ technology.

Public Instance methods

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.

empty()

Alias for clear

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.

Retrieve the items in a shopping cart.

[Validate]