ZMObject
└─ZMShoppingCartItem
public class ZMShoppingCartItem
extends ZMObject
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | __construct(array zenItem) Create new shopping cart item |
| array | Get selected attributes for this cart item. |
| string | getId() Get the cart item id (the sku). |
| void | getImage() |
| void | |
| float | getItemPrice(boolean tax) Get the item price. |
| float | getItemTotal(boolean tax) Get the item/line total. |
| void | getName() |
| float | getOneTimeCharge(boolean tax) Get optional one time charges for this item. |
| ZMProduct | Get the product this item is associated with. |
| int | Get the plain product id of this item. |
| void | getQty() |
| int | Get the number of items in the cart. |
| void | |
| ZMTaxRate | getTaxRate(ZMAddress address) Get the tax rate for this item. |
| boolean | Check if this cart item has attributes or not. |
| boolean | Check if this item has a one time charge attached. |
| boolean | Check stock availability for the current quantity. |
| void | setAttributes(array attributes) Set selected attributes for this cart item. |
| void | setId(string id) Set the cart item id. |
| void | setItemPrice(float itemPrice) Set the item price. |
| void | setOneTimeCharge(float amount) Set optional one time charges for this item. |
| void | setQuantity(int quantity) Set the quantity for this item. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public void __construct(array zenItem)
Create new shopping cart item
public array getAttributes()
Get selected attributes for this cart item.
public string getId()
Get the cart item id (the sku).
This will differ from the product id if attributes are attached to the cart item.
public void getImage()
public void getImageInfo()
public float getItemPrice(boolean tax)
Get the item price.
true to include tax.public float getItemTotal(boolean tax)
Get the item/line total.
true to include tax.public void getName()
public float getOneTimeCharge(boolean tax)
Get optional one time charges for this item.
true to include tax.public ZMProduct getProduct()
Get the product this item is associated with.
public int getProductId()
Get the plain product id of this item.
For items without attributes this is going to be the same as getId(). If attributes are present,
to use the store address.l return something like a skuId while this method will always return the plain
product id without any attribute hash.
public void getQty()
public int getQuantity()
Get the number of items in the cart.
public void getTaxClassId()
public ZMTaxRate getTaxRate(ZMAddress address)
Get the tax rate for this item.
null to use the store address.null.public boolean hasAttributes()
Check if this cart item has attributes or not.
true if there are attributes (values) available, false if not.public boolean hasOneTimeCharge()
Check if this item has a one time charge attached.
true if a one time charge is set.public boolean isStockAvailable()
Check stock availability for the current quantity.
true if sufficient stock is available, false if not.public void setAttributes(array attributes)
Set selected attributes for this cart item.
public void setId(string id)
Set the cart item id.
public void setItemPrice(float itemPrice)
Set the item price.
public void setOneTimeCharge(float amount)
Set optional one time charges for this item.
public void setQuantity(int quantity)
Set the quantity for this item.
A single shopping cart item.
This class can either be populated using the c'tor argument (zen-cart cart info) or implicit as done by the shopping cart service (
ZMShoppingCart)