NAME
Nitesi::Cart
VERSION
CONSTRUCTOR
new
init
Initializer which receives the constructor arguments, but does nothing. May be overridden in a subclass.
items
Returns items in the cart.
total
Returns total of the cart.
add $item
Add item to the cart. Returns item in case of success.
The item is a hash reference which is subject to the following conditions:
- sku
-
Item identifier is required.
- name
-
Item name is required.
- quantity
-
Item quantity is optional and has to be a natural number greater than zero. Default for quantity is 1.
- price
-
Item price is required and a positive number.
clear
Removes all items from the cart.
name
Get or set the name of the cart.
error
Returns last error.
seed $item_ref
Seeds items within the cart from $item_ref.