Interchange6::Cart::Product - Cart product class for Interchange6 Shop Machine
Cart product class for Interchange6.
See Interchange6::Role::Costs for details of cost attributes and methods.
Each cart product has the following attributes:
Can be used by subclasses, e.g. primary key value for cart products in the database.
A reference to the Cart object that this Cart::Product belongs to.
Product name is required.
Product price is required and a positive number or zero.
Price is required, because you want to maintain the price that was valid at the time of adding to the cart. Should the price in the shop change in the meantime, it will maintain this price.
Selling price is the price after group pricing, tier pricing or promotional discounts have been applied. If it is not set then it defaults to "price".
Product quantity is optional and has to be a natural number greater than zero. Default for quantity is 1.
Unique product identifier is required.
If this product is a variant of a "parent" product then
canonical_sku is the sku of the parent product.
Weight of quantity 1 of this product.
Hash reference of extra things the cart product might want to store such as:
variant attributes in order to be able to change variant within cart
simple attributes to allow display of them within cart
Indicate whether products with the same SKU should be combined in the Cart
See also "METHODS" in Interchange6::Role::Costs.
get_extra($key, $key2, $key3...)
set_extra($key => $value, $key2 => $value2...)
delete_extra($key, $key2, $key3...)
Returns 1 if "canonical_sku" is defined else 0.
Returns 0 if "canonical_sku" is defined else 1.
Determines whether a product should be combined by sku based on the value of "combine".
If "combine" isa CodeRef the result of applying that CodeRef is returned otherwise: Returns 0 if a product should not be combined Returns 1 if a product should be combined