|
NAMEInterchange6::Cart::Product - Cart product class for Interchange6 Shop MachineDESCRIPTIONCart product class for Interchange6.See Interchange6::Role::Costs for details of cost attributes and methods. ATTRIBUTESSee also "ATTRIBUTES" in Interchange6::Role::Costs.Each cart product has the following attributes: idCan be used by subclasses, e.g. primary key value for cart products in the database.cartA reference to the Cart object that this Cart::Product belongs to.
nameProduct name is required.priceProduct 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_priceSelling 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".
discount_percentThis is the integer discount percentage calculated from the difference between "price" and "selling_price". This attribute should not normally be set since as it is a calculated value."discount_percent" is cleared if either "set_price" or set_selling_price methods are called. quantityProduct quantity is optional and has to be a natural number greater than zero. Default for quantity is 1.skuUnique product identifier is required.canonical_skuIf this product is a variant of a "parent" product then "canonical_sku" is the sku of the parent product.subtotalSubtotal calculated as "price" * "quantity". Lazy set via builder.uriProduct uriweightWeight of quantity 1 of this product.extraHash reference of extra things the cart product might want to store such as:
combineIndicate whether products with the same SKU should be combined in the Cart
METHODSSee also "METHODS" in Interchange6::Role::Costs."extra" methods
"subtotal" methods
is_variantReturns 1 if "canonical_sku" is defined else 0.is_canonicalReturns 0 if "canonical_sku" is defined else 1.should_combine_by_skuDetermines 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
Visit the GSP FreeBSD Man Page Interface. |