|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CartItem
A CartItem
represents a quantity of SKUs in a shopping cart, saved cart, wish list, etc.
Method Summary | |
---|---|
void |
addDependentCartItem(CartItem dependentCartItem)
Specify that another cart item depends on this cart item. |
void |
applyDiscount(java.math.BigDecimal amount)
Adds a discount amount to this cart item. |
void |
clearDiscount()
Removes previously applied CartItem discounts. |
java.math.BigDecimal |
getAmount(java.util.Currency currency)
Get the total price of this shopping cart item. |
Money |
getAmountMoney(java.util.Currency currency)
Get the amount as a Money object. |
java.util.Set |
getDependentCartItems()
Get the set of dependent cart items. |
CartItem |
getParentCartItem()
Get the parent cart item that this cart item is dependent on. |
ProductSku |
getProductSku()
Get the product SKU corresponding to this item in a cart. |
int |
getQuantity()
Get the quantity of this item. |
java.lang.String |
getType()
Get the type of action, i.e. |
boolean |
hasDependentCartItem(java.lang.String skuCode)
Returns true if this CartItem has another cart items that depend on it which matches the supplied skuCode. |
boolean |
hasDependentCartItems()
Returns true if this CartItem has other cart items that depend on it such that the dependent items cannot exist in the cart on their own. |
boolean |
hasSufficientInventory()
Returns true if there is sufficent stock to sell this cart item (in the quantity set in the CartItem). |
boolean |
isDependent()
Returns true if this CartItem depends on another cart item such that it can't exist in the cart on its own. |
void |
setDependentCartItems(java.util.Set dependentCartItems)
Set the set of dependent cart items. |
void |
setParentCartItem(CartItem parentCartItem)
Set the parent cart item that this cart item is dependent on. |
void |
setProductSku(ProductSku productSku)
Set the product SKU corresponding to this item in a cart. |
void |
setQuantity(int quantity)
Set the quantity of this item. |
void |
setType(java.lang.String type)
Set the type of action. |
Methods inherited from interface com.elasticpath.domain.Persistence |
---|
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk |
Methods inherited from interface com.elasticpath.domain.EpDomain |
---|
getElasticPath, setElasticPath |
Method Detail |
---|
void addDependentCartItem(CartItem dependentCartItem)
dependentCartItem
- the other, dependent cart itemvoid applyDiscount(java.math.BigDecimal amount)
amount
- the amount to discountvoid clearDiscount()
java.math.BigDecimal getAmount(java.util.Currency currency)
currency
- the currency of the total price to be returned
BigDecimal
object representing the total priceMoney getAmountMoney(java.util.Currency currency)
Money
object.
currency
- the currency of the total price to be returned
Money
object representing the total pricejava.util.Set getDependentCartItems()
CartItem getParentCartItem()
ProductSku getProductSku()
ProductSKU
int getQuantity()
java.lang.String getType()
boolean hasDependentCartItem(java.lang.String skuCode)
skuCode
- The GUID of the particular dependant SKU to be in the cart.
boolean hasDependentCartItems()
boolean hasSufficientInventory()
boolean isDependent()
void setDependentCartItems(java.util.Set dependentCartItems)
dependentCartItems
- the set of dependent cart items.void setParentCartItem(CartItem parentCartItem)
parentCartItem
- the parent cart item.void setProductSku(ProductSku productSku)
productSku
- the ProductSKU
void setQuantity(int quantity)
quantity
- the quantityvoid setType(java.lang.String type)
type
- the type of action
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |