public class DefaultCartLoaderStrategy extends java.lang.Object implements CartLoaderStrategy
| Constructor and Description |
|---|
DefaultCartLoaderStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyCurrencyToCartAndRecalculateIfNeeded()
Checks currently set currency and compares it with one set in cart.
|
protected void |
checkCartExpiration(java.lang.String requestedCartID,
java.lang.String restoredCartID)
Checks whether cart expired and informs user about the change
|
protected BaseSiteService |
getBaseSiteService() |
protected CartService |
getCartService() |
protected CommerceCartService |
getCommerceCartService() |
CommerceCommonI18NService |
getCommerceCommonI18NService() |
ModelService |
getModelService() |
protected boolean |
isBaseSiteValid(CartModel cart)
Checks if base site set in the cart is the same as one set in baseSiteService.
|
boolean |
isCartRefreshedByDefault() |
protected void |
loadAnonymousCart(java.lang.String cartID,
boolean refresh)
Loads anonymous or guest cart
|
void |
loadCart(java.lang.String cartId)
Loads cart for current session
|
void |
loadCart(java.lang.String cartId,
boolean refresh)
Loads cart for current session
|
protected void |
loadUserCart(java.lang.String cartID,
boolean refresh)
Loads customer's cart
|
protected void |
restoreCart(CartModel cart,
java.lang.String requestedCartId,
boolean refresh) |
void |
setBaseSiteService(BaseSiteService baseSiteService) |
void |
setCartRefreshedByDefault(boolean cartRefreshedByDefault) |
void |
setCartService(CartService cartService) |
void |
setCommerceCartService(CommerceCartService commerceCartService) |
void |
setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService) |
void |
setModelService(ModelService modelService) |
void |
setUserService(UserService userService) |
public void loadCart(java.lang.String cartId)
CartLoaderStrategyloadCart in interface CartLoaderStrategycartId - Cart identifier (can be guid or code)public void loadCart(java.lang.String cartId,
boolean refresh)
CartLoaderStrategyloadCart in interface CartLoaderStrategycartId - Cart identifier (can be guid or code)refresh - Define if cart should be refreshed (recalculated). Refreshing cart can change it.protected void loadUserCart(java.lang.String cartID,
boolean refresh)
cartID - protected void restoreCart(CartModel cart, java.lang.String requestedCartId, boolean refresh)
protected void loadAnonymousCart(java.lang.String cartID,
boolean refresh)
cartID - protected boolean isBaseSiteValid(CartModel cart)
protected void applyCurrencyToCartAndRecalculateIfNeeded()
protected void checkCartExpiration(java.lang.String requestedCartID,
java.lang.String restoredCartID)
requestedCartID - public void setUserService(UserService userService)
protected CommerceCartService getCommerceCartService()
public void setCommerceCartService(CommerceCartService commerceCartService)
protected CartService getCartService()
public void setCartService(CartService cartService)
protected BaseSiteService getBaseSiteService()
public void setBaseSiteService(BaseSiteService baseSiteService)
public CommerceCommonI18NService getCommerceCommonI18NService()
public void setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
public ModelService getModelService()
public void setModelService(ModelService modelService)
public boolean isCartRefreshedByDefault()
public void setCartRefreshedByDefault(boolean cartRefreshedByDefault)
Copyright © 2018 SAP SE. All Rights Reserved.