|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ShoppingCart
ShoppingCart
represents a shopping cart of a Customer
.
Method Summary | |
---|---|
CartItem |
addAssociatedCartItem(ProductAssociation productAssociation,
CartItem parentCartItem)
Adds an item to the cart where the source of the item information is a ProductAssociation . |
CartItem |
addCartItem(CartItem cartItem)
Add an item to the cart. |
CartItem |
addCartItem(ProductSku productSku,
int quantity)
Convenience method for adding an item to the cart. |
CartItem |
addWishListItem(ProductSku productSku)
Convenience method for adding an item to the wishlist. |
boolean |
allowCheckout()
Returns true if the shopping cart is in a state that the customer can proceed with a checkout. |
void |
calculateShoppingCartTaxAndBeforeTaxPrices()
Calculate the taxes and before-tax prices for the giveing shoppingCart, including cart item and shipping cost. |
void |
clearEstimates()
Removes shipping and tax estimates from the shopping cart. |
void |
clearItems()
Empties the shopping cart (e.g. |
void |
clearSelectedShippingServiceLevel()
Resets the selected ShippingServiceLevel to null. |
void |
fireRules()
Forces the shopping cart to apply promotion rules. |
java.util.Set |
getAppliedRules()
Get the set of rules that have been applied to the cart. |
Money |
getBeforeTaxShippingCost()
Return the before-tax shippingCost. |
Money |
getBeforeTaxSubTotal()
Return the before-tax subtotal. |
Money |
getBeforeTaxTotal()
Return the before-tax total. |
Address |
getBillingAddress()
Get the preferred billing address. |
CatalogViewResultHistory |
getBrowsingResultHistory()
Returns the browsing result history stored. |
CartItem |
getCartItem(java.lang.String skuGuid)
Get a cart item by the GUID of its SKU. |
CartItem |
getCartItemById(long cartItemId)
Returns the cart item with the given id. |
java.util.List |
getCartItems()
Get the cart items in the shopping cart. |
java.util.List |
getCartProducts()
Get the products in the shopping cart. |
CatalogViewResultHistory |
getCatalogViewResultHistory()
Returns the catalog view result history stored. |
Order |
getCompletedOrder()
Get a reference to the completed order for the items previously checked out. |
java.util.Currency |
getCurrency()
Get the currency of the customer corresponding to the shopping cart. |
CustomerSession |
getCustomerSession()
Return the CustomerSession . |
java.lang.String |
getCustomerSessionGuid()
Return the guid of the customer session that corresponds to this shopping cart. |
java.lang.String |
getIpAddress()
Get the ipAddress of the user from the shopping cart. |
Category |
getLastCategory()
Returns the last category. |
java.util.Locale |
getLocale()
Get the locale of the customer corresponding to the shopping cart. |
java.util.Map |
getLocalizedTaxMap()
Return the localized tax category name -> tax value ( Money ) map for this ShoppingCart . |
int |
getNumItems()
Return the number of items in the shopping cart. |
java.util.List |
getProductAssociationsByType(int associationType,
int maxAssociations,
boolean filter)
Get a list of ProductAssociation s that specify associations between items in the cart and other related products. |
java.lang.String |
getPromotionCode()
Get the promotion code entered by the user. |
java.util.List |
getRemovedCartItems()
Get the cart items that have been removed from the shopping cart. |
CatalogViewResultHistory |
getSearchResultHistory()
Returns the search result history stored. |
ShippingServiceLevel |
getSelectedShippingServiceLevel()
Get the selectedShippingServiceLevel. |
Address |
getShippingAddress()
Get the preferred shipping address. |
Money |
getShippingCost()
Return the shippingCost of the ShoppingCart . |
java.util.List |
getShippingServiceLevelList()
Return the list of shippingServiceLevel list available based on the current shopping cart info. |
java.math.BigDecimal |
getSubtotal()
Get the subtotal of all items in the cart. |
java.math.BigDecimal |
getSubtotalDiscount()
Get the discount to the shopping cart subtotal. |
Money |
getSubtotalDiscountMoney()
Get the amount discounted from the order subtotal. |
Money |
getSubtotalMoney()
Get the subtotal of all items in the cart. |
java.util.Map |
getTaxMap()
Return the TaxCategory -> tax value (Money ) map for this ShoppingCart . |
java.math.BigDecimal |
getTotal()
Get the sub total of all items in the cart after shipping, promotions, etc. |
Money |
getTotalMoney()
Get the sub total of all items in the cart after shipping, promotions, etc. |
java.math.BigDecimal |
getTotalWeight()
Get the totalWeight of items in ShoppingCart . |
ViewHistory |
getViewHistory()
Get the View History of the user from the shopping cart. |
java.util.List |
getWishListItems()
Get the wish list items in the shopping cart. |
boolean |
hasSubtotalDiscount()
Returns true if an order subtotal discount has been applied. |
void |
init()
Initializes the shopping cart. |
boolean |
isEstimateMode()
Get the indicator of whether in the estimate shipping and taxes mode. |
boolean |
isInclusiveTaxCalculationInUse()
Return true if the "inclusive" tax calculation method is in use; otherwise false. |
boolean |
isPromotionCodeAccepted()
Indicates if the promotion code set by the user is valid. |
void |
removeCartItem(long itemUid)
Remove an item from the cart. |
void |
removeWishListItem(long itemUid)
Remove an item from the wish list. |
boolean |
requiresShipping()
Returns true if the cart contains items that must be shipped to the customer. |
void |
ruleApplied(long ruleId)
Indicates that the given rule was applied by the promotion rule engine. |
void |
setBillingAddress(Address address)
Set the preferred billing address. |
void |
setCartItems(java.util.List cartItems)
Set the cart items in the shopping cart. |
void |
setCompletedOrder(Order order)
Set a reference to the completed order for the items previously checked out. |
void |
setCurrency(java.util.Currency currency)
Set the currency of the customer corresponding to the shopping cart. |
void |
setCustomerSession(CustomerSession customerSession)
Set the CustomerSession . |
void |
setCustomerSessionGuid(java.lang.String guid)
Set the guid of the customer session that corresponds to this shopping cart. |
void |
setEstimateMode(boolean estimateMode)
Set the indicator of whether in the estimate shipping and taxes mode. |
void |
setIpAddress(java.lang.String ipAddress)
Set the users ip Address into the shopping cart. |
void |
setLastCategory(Category category)
Sets the last category. |
void |
setLocale(java.util.Locale locale)
Set the locale of the customer corresponding to the shopping cart. |
void |
setPromotionCode(java.lang.String promotionCode)
Set the promotion code entered by the user. |
void |
setPromotionCodeAccepted(boolean promotionCodeAccepted)
Set whether or not the promotion code entered by the user is valid. |
Money |
setSelectedShippingServiceLevelUid(long selectedSSLUid)
Set the selectedShippingServiceLevelUid and update the shippingCost correspondingly. |
void |
setShippingAddress(Address address)
Set the preferred shipping address. |
void |
setShippingServiceLevelList(java.util.List shippingServiceLevelList)
Set the list of shippingServiceLevel list available based on the current shopping cart info. |
void |
setSubtotalDiscount(java.math.BigDecimal discountAmount)
Applies a discount to the shopping cart subtotal. |
void |
setTaxJurisdiction(TaxJurisdiction taxJurisdiction)
Set the most specific TaxJurisdiction based on the shippingAddress of this ShoppingCart . |
void |
setWishListItems(java.util.List wishListItems)
Set the wish list items in the shopping cart. |
CartItem |
updateCartItemByGuid(java.lang.String skuGuid,
int quantity)
Updates an existing cart item in the shopping cart, found by the guid of its product SKU. |
CartItem |
updateCartItemById(long cartItemId,
java.lang.String skuGuid,
int quantity)
Updates an existing cart item in the shopping cart. |
Methods inherited from interface com.elasticpath.domain.Entity |
---|
getGuid, setGuid |
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 |
---|
CartItem addAssociatedCartItem(ProductAssociation productAssociation, CartItem parentCartItem)
ProductAssociation
.
productAssociation
- the ProductAssociation
referencing the item to be addedparentCartItem
- the CartItem
containing the product that is the source of the ProductAssociation
CartItem
containing the target of the ProductAssociation
CartItem addCartItem(CartItem cartItem)
cartItem
- the CartItem
to add
CartItem addCartItem(ProductSku productSku, int quantity)
productSku
- the SKU to be added to the cartquantity
- the quantity of the SKU to be added
CartItem
representing the item in the cartCartItem addWishListItem(ProductSku productSku)
productSku
- the SKU to be added to the wishlist *
CartItem
representing the item in the wishlistboolean allowCheckout()
void calculateShoppingCartTaxAndBeforeTaxPrices()
void clearEstimates()
void clearItems()
void clearSelectedShippingServiceLevel()
ShippingServiceLevel
to null.
void fireRules()
java.util.Set getAppliedRules()
Long
Rule UidPksMoney getBeforeTaxShippingCost()
Money getBeforeTaxSubTotal()
Money getBeforeTaxTotal()
Address getBillingAddress()
CatalogViewResultHistory getBrowsingResultHistory()
CartItem getCartItem(java.lang.String skuGuid)
skuGuid
- the GUID of the SKU in the cart item to be retrieved.
CartItem
or null if not foundCartItem getCartItemById(long cartItemId)
cartItemId
- the cart item id
java.util.List getCartItems()
java.util.List getCartProducts()
CatalogViewResultHistory getCatalogViewResultHistory()
null
Order getCompletedOrder()
java.util.Currency getCurrency()
Currency
CustomerSession getCustomerSession()
CustomerSession
. instance. Customer sessions track information about sessions where the customer may not be logged
in.
CustomerSession
instancejava.lang.String getCustomerSessionGuid()
java.lang.String getIpAddress()
Category getLastCategory()
java.util.Locale getLocale()
Locale
java.util.Map getLocalizedTaxMap()
Money
) map for this ShoppingCart
.
Money
) map.int getNumItems()
java.util.List getProductAssociationsByType(int associationType, int maxAssociations, boolean filter)
ProductAssociation
s that specify associations between items in the cart and other related products. The product
associations are returned in decreasing order of the sales quantity of the targetted product.
associationType
- the type of the ProductAssociation
s to be returned. Use a constant defined in the
ProductAssociation
interfacemaxAssociations
- the maximum number of associations to returnfilter
- when true will filter the results to remove any ProductAssociations allready in the shopping cart. *
ProductAssociation
s, ordered by number of sales.java.lang.String getPromotionCode()
java.util.List getRemovedCartItems()
CatalogViewResultHistory getSearchResultHistory()
ShippingServiceLevel getSelectedShippingServiceLevel()
Address getShippingAddress()
Money getShippingCost()
ShoppingCart
.
ShoppingCart
java.util.List getShippingServiceLevelList()
java.math.BigDecimal getSubtotal()
BigDecimal
object representing the subtotaljava.math.BigDecimal getSubtotalDiscount()
Money getSubtotalDiscountMoney()
Money
objectMoney getSubtotalMoney()
Money
object representing the subtotaljava.util.Map getTaxMap()
TaxCategory
-> tax value (Money
) map for this ShoppingCart
.
TaxCategory
-> tax value (Money
) map.java.math.BigDecimal getTotal()
BigDecimal
object representing the totalMoney getTotalMoney()
Money
object representing the totaljava.math.BigDecimal getTotalWeight()
ShoppingCart
.
ViewHistory getViewHistory()
java.util.List getWishListItems()
boolean hasSubtotalDiscount()
void init()
boolean isEstimateMode()
boolean isInclusiveTaxCalculationInUse()
boolean isPromotionCodeAccepted()
void removeCartItem(long itemUid)
itemUid
- the uidPk of the CartItem
to removevoid removeWishListItem(long itemUid)
itemUid
- the uidPk of the CartItem
to removeboolean requiresShipping()
void ruleApplied(long ruleId)
ruleId
- the uidPk of the Rule
void setBillingAddress(Address address)
address
- the Address
void setCartItems(java.util.List cartItems)
cartItems
- the cart items in the shopping cart.void setCompletedOrder(Order order)
order
- the completed ordervoid setCurrency(java.util.Currency currency)
currency
- the Currency
void setCustomerSession(CustomerSession customerSession)
CustomerSession
. instance. Customer sessions track information about sessions where the customer may not be logged in.
customerSession
- the CustomerSession
instancevoid setCustomerSessionGuid(java.lang.String guid)
guid
- the guid to set.void setEstimateMode(boolean estimateMode)
estimateMode
- true when estimating shipping and taxes; otherwise, false.void setIpAddress(java.lang.String ipAddress)
ipAddress
- the ipAddress of the user.void setLastCategory(Category category)
category
- the category to set.void setLocale(java.util.Locale locale)
locale
- the Locale
void setPromotionCode(java.lang.String promotionCode)
promotionCode
- the promotion codevoid setPromotionCodeAccepted(boolean promotionCodeAccepted)
promotionCodeAccepted
- set to true if the promotion code is validMoney setSelectedShippingServiceLevelUid(long selectedSSLUid)
selectedSSLUid
- - the selected ShippingServiceLevel uid.
void setShippingAddress(Address address)
address
- the Address
void setShippingServiceLevelList(java.util.List shippingServiceLevelList)
shippingServiceLevelList
- the list of shippingServiceLevel list available based on the current shopping cart info.void setSubtotalDiscount(java.math.BigDecimal discountAmount)
discountAmount
- the amount to discount the subtotal by as a BigIntegervoid setTaxJurisdiction(TaxJurisdiction taxJurisdiction)
TaxJurisdiction
based on the shippingAddress of this ShoppingCart
.
taxJurisdiction
- the most specific TaxJurisdiction
void setWishListItems(java.util.List wishListItems)
wishListItems
- the wish list items in the shopping cart.CartItem updateCartItemByGuid(java.lang.String skuGuid, int quantity)
skuGuid
- The GUID of the particular SKU in the cart item to be updatedquantity
- the quantity of the given cart item to appear in the cart
CartItem
CartItem updateCartItemById(long cartItemId, java.lang.String skuGuid, int quantity)
cartItemId
- the UID of the cart item to be updated. The suppliced UID must match a cart item
in the cart.skuGuid
- The GUID of the particular SKU to be in the cart. If skuGuid is null or "", then the
sku in the cart item will not be updated. If the skuGuid is specified, then the SKU in the cart item
will be changed to the one matching the specified GUID. An exception will be thrown if the GUID does not
match a SKU from the previous SKU's product (Changing the product is not an update operation).quantity
- the quantity of the given cart item to appear in the cart
CartItem
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |