|
|||||||||
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(ProductSku productSku,
int quantity)
Convenience method for adding an item to the cart. |
CartItem |
addCartItem(ShoppingCartItem cartItem)
Add an item to the cart. |
GiftCertificateItem |
addGiftCertificateItem(GiftCertificateItem giftCertificateItem)
Add a giftCertificate 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 |
applyGiftCertificate(GiftCertificate giftCertificate)
Adds the given gift certificate to the set which will be redeemed / applied to this shopping cart. |
void |
applyPromotionCode(java.lang.String promotionCode)
Add a new promotion code to the list of promotion codes added to the shopping cart. |
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.List<CartItem> |
getAllItems()
Get all the items in the shopping cart, including the ShoppingCartItems, WishListItems, GiftCertificateItems. |
java.util.List<Rule> |
getApplicableRules()
Returns the list of promotion rules that are applicable to the cart based on rule conditions and promo codes in the cart. |
java.util.Set<GiftCertificate> |
getAppliedGiftCertificates()
Get the set of applied gift certificates. |
java.util.Set<java.lang.Long> |
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. |
ShoppingCartItem |
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<ShoppingCartItem> |
getCartItems()
Get the cart items in the shopping cart. |
java.util.List<Product> |
getCartProducts()
Get the products in the shopping cart. |
CatalogViewResultHistory |
getCatalogViewResultHistory()
Returns the catalog view result history stored. |
java.lang.Long |
getCmUserUID()
Gets the cmUserUID. |
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.math.BigDecimal |
getGiftCertificateDiscount()
Get the amount redeemed from gift certificate. |
GiftCertificateItem |
getGiftCertificateItemById(long giftCertificateItemId)
Returns the gift certificate item with the given id. |
java.util.List<GiftCertificateItem> |
getGiftCertificateItems()
Get the GiftCertificate items in the shopping cart. |
java.lang.String |
getGuid()
Return the guid. |
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<java.lang.String,Money> |
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<ProductAssociation> |
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.util.List<java.lang.String> |
getPromotionCodes()
Gets the list of promotion codes successfully applied to the 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<ShippingServiceLevel> |
getShippingServiceLevelList()
Return the list of shippingServiceLevel list available based on the current shopping cart info. |
ShoppingCartMemento |
getShoppingCartMemento()
Gets the persistent shopping cart object. |
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. |
TaxCalculationResult |
getTaxCalculationResult()
Retrieves the current tax values. |
java.util.Map<TaxCategory,Money> |
getTaxMap()
Retrieves the mapping of TaxCategories to values. |
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 . |
long |
getUidPk()
Gets the unique identifier for this domain object. |
java.util.Collection<ShoppingCartItem> |
getUnavailableCartItems()
Get the cart items that have been removed from the shopping cart because of they have run out of stock meanwhile. |
ViewHistory |
getViewHistory()
Get the View History of the user from the shopping cart. |
java.util.List<CartItem> |
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 |
isCartItemRemoved(java.lang.String skuCode)
Checks if a cart item with specific SKU code was previously removed. |
boolean |
isCodeValid()
Indicates if the promotion or gift certificate code entered by the user is valid. |
boolean |
isEstimateMode()
Get the indicator of whether in the estimate shipping and taxes mode. |
boolean |
isExchangeOrderShoppingCart()
Returns true is this shopping cart will be used for checking out exchange order, false for ordinary shopping cart. |
boolean |
isInclusiveTaxCalculationInUse()
Return true if the "inclusive" tax calculation method is in use; otherwise false. |
boolean |
isPersistent()
true if the object has previously been persisted. |
boolean |
isValidPromoCode(java.lang.String code)
Validates if the code matches a promotion code in the system. |
void |
removeCartItem(long itemUid)
Remove an item from the cart. |
void |
removeGiftCertificateItem(long itemUid)
Remove a giftCertificate from the cart. |
void |
removePromotionCode(java.lang.String promotionCode)
Remove a promotion code from the list of promotion codes added to the shopping 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 |
setCmUserUID(java.lang.Long cmUserUID)
Sets the CmUserUID. |
void |
setCodeValid(boolean codeValid)
Set whether or not the promotion or gift certificate code entered by the user is valid. |
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 |
setExchangeOrderShoppingCart(boolean isExchangeOrderShoppingCart)
Sets the flag depending if this shopping cart will be used for checking out exchange order, or for ordinary shopping cart. |
void |
setGiftCertificateItems(java.util.List<GiftCertificateItem> giftCertificateItems)
Set the GiftCertificate items in the shopping cart. |
void |
setGuid(java.lang.String guid)
Set the guid. |
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 |
setPromotionCodes(java.util.List<java.lang.String> promotionCodes)
Sets the list of promotion codes successfully applied to the cart. |
Money |
setSelectedShippingServiceLevelUid(long selectedSSLUid)
Set the selectedShippingServiceLevelUid and update the shippingCost correspondingly. |
void |
setShippingAddress(Address address)
Set the preferred shipping address. |
void |
setShippingCost(java.math.BigDecimal shippingCost)
Set shipping cost. |
void |
setShippingServiceLevelList(java.util.List<ShippingServiceLevel> shippingServiceLevelList)
Set the list of shippingServiceLevel list available based on the current shopping cart info. |
void |
setShoppingCartMemento(ShoppingCartMemento shoppingCartMemento)
|
void |
setSubtotalDiscount(java.math.BigDecimal discountAmount)
Applies a discount to the shopping cart subtotal. |
void |
setTaxCalculationResult(TaxCalculationResult taxCalculationResult)
Sets the tax calculation result. |
void |
setUidPk(long uidPk)
Sets the unique identifier for this domain model object. |
void |
setWishListItems(java.util.List<CartItem> 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.bea.alcs.domain.EpDomain |
---|
getElasticPath, getUtility, setDefaultValues, setElasticPath |
Methods inherited from interface com.bea.alcs.domain.catalog.StoreObject |
---|
getStore, setStore |
Method Detail |
---|
java.lang.String getGuid()
void setGuid(java.lang.String guid)
guid
- the guid to set.long getUidPk()
Notice: not all persistent domain objects has unique identifier. Some value objects don't have unique identifer. They are cascading loaded and updated through their parents.
void setUidPk(long uidPk)
uidPk
- the new unique identifier.boolean isPersistent()
true
if the object has previously been persisted.
Notice: not all persistent domain objects has unique identifier. Some value objects don't have unique identifer. They are cascading loaded and updated through their parents. It doesn't make sense to call this method on those value object.
true
if the object has previously been persisted.java.util.Set<GiftCertificate> getAppliedGiftCertificates()
void applyGiftCertificate(GiftCertificate giftCertificate)
giftCertificate
- the gift certificate.java.math.BigDecimal getGiftCertificateDiscount()
CustomerSession getCustomerSession()
CustomerSession
. instance. Customer sessions track information about sessions where the customer may not be logged
in.
CustomerSession
instancevoid setCustomerSession(CustomerSession customerSession)
CustomerSession
. instance. Customer sessions track information about sessions where the customer may not be logged in.
customerSession
- the CustomerSession
instancejava.util.Locale getLocale()
Locale
void setLocale(java.util.Locale locale)
locale
- the Locale
java.util.Currency getCurrency()
Currency
void setCurrency(java.util.Currency currency)
currency
- the Currency
void init()
java.lang.String getCustomerSessionGuid()
void setCustomerSessionGuid(java.lang.String guid)
guid
- the guid to set.java.util.List<ShoppingCartItem> getCartItems()
java.util.List<Product> getCartProducts()
java.util.Collection<ShoppingCartItem> getUnavailableCartItems()
java.util.List<GiftCertificateItem> getGiftCertificateItems()
void setGiftCertificateItems(java.util.List<GiftCertificateItem> giftCertificateItems)
giftCertificateItems
- the GiftCertificate items in the shopping cart.java.util.List<CartItem> getWishListItems()
void setWishListItems(java.util.List<CartItem> wishListItems)
wishListItems
- the wish list items in the shopping cart.CartItem addCartItem(ShoppingCartItem cartItem)
cartItem
- the CartItem
to add
void removeCartItem(long itemUid)
itemUid
- the uidPk of the CartItem
to removeGiftCertificateItem addGiftCertificateItem(GiftCertificateItem giftCertificateItem)
giftCertificateItem
- the GiftCertificateItem
to add
void removeGiftCertificateItem(long itemUid)
itemUid
- the uidPk of the GiftCertificateItem
to removevoid removeWishListItem(long itemUid)
itemUid
- the uidPk of the CartItem
to removeShoppingCartItem getCartItem(java.lang.String skuGuid)
skuGuid
- the GUID of the SKU in the cart item to be retrieved.
CartItem
or null if not foundint getNumItems()
java.math.BigDecimal getSubtotal()
BigDecimal
object representing the subtotalMoney getSubtotalMoney()
Money
object representing the subtotalMoney getTotalMoney()
Money
object representing the totaljava.math.BigDecimal getTotal()
BigDecimal
object representing the totalvoid setSubtotalDiscount(java.math.BigDecimal discountAmount)
discountAmount
- the amount to discount the subtotal by as a BigIntegerjava.math.BigDecimal getSubtotalDiscount()
Money getSubtotalDiscountMoney()
Money
objectboolean hasSubtotalDiscount()
void clearItems()
void setBillingAddress(Address address)
address
- the Address
Address getBillingAddress()
void setShippingAddress(Address address)
address
- the Address
Address getShippingAddress()
Category getLastCategory()
void setLastCategory(Category category)
category
- the category to set.void setCompletedOrder(Order order)
order
- the completed orderOrder getCompletedOrder()
CatalogViewResultHistory getSearchResultHistory()
CatalogViewResultHistory getBrowsingResultHistory()
CatalogViewResultHistory getCatalogViewResultHistory()
null
Money getShippingCost()
ShoppingCart
.
ShoppingCart
java.util.List<ShippingServiceLevel> getShippingServiceLevelList()
void setShippingServiceLevelList(java.util.List<ShippingServiceLevel> shippingServiceLevelList)
shippingServiceLevelList
- the list of shippingServiceLevel
list available based on the current shopping cart info.
If parameter value is null the list will be cleared.ShippingServiceLevel getSelectedShippingServiceLevel()
Money setSelectedShippingServiceLevelUid(long selectedSSLUid)
selectedSSLUid
- - the selected ShippingServiceLevel uid.
void clearSelectedShippingServiceLevel()
ShippingServiceLevel
to null.
java.math.BigDecimal getTotalWeight()
ShoppingCart
.
boolean requiresShipping()
boolean isInclusiveTaxCalculationInUse()
java.util.Map<java.lang.String,Money> getLocalizedTaxMap()
Money
) map for this ShoppingCart
.
Money
) map.Money getBeforeTaxShippingCost()
Money getBeforeTaxSubTotal()
Money getBeforeTaxTotal()
void calculateShoppingCartTaxAndBeforeTaxPrices()
java.util.List<ProductAssociation> 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.CartItem getCartItemById(long cartItemId)
cartItemId
- the cart item id
GiftCertificateItem getGiftCertificateItemById(long giftCertificateItemId)
giftCertificateItemId
- the giftCertificate item id
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
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 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 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 addWishListItem(ProductSku productSku)
productSku
- the SKU to be added to the wishlist *
CartItem
representing the item in the wishlistjava.util.List<java.lang.String> getPromotionCodes()
void setPromotionCodes(java.util.List<java.lang.String> promotionCodes)
promotionCodes
- the promotion codesvoid applyPromotionCode(java.lang.String promotionCode)
promotionCode
- the promotion code to add to the listvoid removePromotionCode(java.lang.String promotionCode)
promotionCode
- the promotion code to remove from the listboolean isValidPromoCode(java.lang.String code)
code
- the code to validate
boolean isCodeValid()
void setCodeValid(boolean codeValid)
codeValid
- set to true if the code is validvoid clearEstimates()
java.lang.String getIpAddress()
void setIpAddress(java.lang.String ipAddress)
ipAddress
- the ipAddress of the user.ViewHistory getViewHistory()
boolean allowCheckout()
boolean isEstimateMode()
void setEstimateMode(boolean estimateMode)
estimateMode
- true when estimating shipping and taxes; otherwise, false.java.util.List<CartItem> getAllItems()
void fireRules()
java.util.List<Rule> getApplicableRules()
Rule
objectsvoid ruleApplied(long ruleId)
ruleId
- the uidPk of the Rule
java.util.Set<java.lang.Long> getAppliedRules()
Long
Rule UidPksTaxCalculationResult getTaxCalculationResult()
java.util.Map<TaxCategory,Money> getTaxMap()
void setTaxCalculationResult(TaxCalculationResult taxCalculationResult)
taxCalculationResult
- the tax calculation result to setjava.lang.Long getCmUserUID()
void setCmUserUID(java.lang.Long cmUserUID)
cmUserUID
- the cmUser's uidvoid setShippingCost(java.math.BigDecimal shippingCost)
shippingCost
- the shipping costboolean isExchangeOrderShoppingCart()
void setExchangeOrderShoppingCart(boolean isExchangeOrderShoppingCart)
isExchangeOrderShoppingCart
- exchange shopping cart flag.ShoppingCartMemento getShoppingCartMemento()
void setShoppingCartMemento(ShoppingCartMemento shoppingCartMemento)
shoppingCartMemento
- the shoppingCartPersistent to setboolean isCartItemRemoved(java.lang.String skuCode)
skuCode
- the SKU code to check
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |