Class UpdateCartServiceImpl
java.lang.Object
org.broadleafcommerce.core.web.service.UpdateCartServiceImpl
- All Implemented Interfaces:
UpdateCartService
@Service("blUpdateCartService")
public class UpdateCartServiceImpl
extends Object
implements UpdateCartService
Author: jerryocanas
Date: 9/26/12
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected UpdateCartServiceExtensionManagerprotected static final org.apache.commons.logging.Logprotected org.broadleafcommerce.core.order.service.OrderLockManagerprotected org.broadleafcommerce.core.order.service.OrderServiceprotected static org.broadleafcommerce.common.currency.domain.BroadleafCurrency -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckAvailabilityInLocale(org.broadleafcommerce.core.order.domain.DiscreteOrderItem doi, org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency) org.broadleafcommerce.core.order.service.call.UpdateCartResponsecopyCartToCurrentContext(org.broadleafcommerce.core.order.domain.Order currentCart) Reprices the order by removing all items and recreating the cart calling for a reprice on the new cart.booleanCompares the currency set in the BroadleafRequestContext with the savedCurrency.protected org.broadleafcommerce.common.currency.domain.BroadleafCurrencyprotected booleanorg.broadleafcommerce.common.currency.domain.BroadleafCurrencyGets the currency that was set as active on last pass through.protected ObjectvoidsetSavedCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency savedCurrency) Sets the currency that was set as active on last pass through.voidupdateAndValidateCart(org.broadleafcommerce.core.order.domain.Order cart) Updates the cart (locale, pricing) and performs validation.voidvalidateAddToCartRequest(org.broadleafcommerce.core.order.service.call.OrderItemRequestDTO itemRequest, org.broadleafcommerce.core.order.domain.Order cart) Validates the given add item that will be added to the given cart.
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
savedCurrency
protected static org.broadleafcommerce.common.currency.domain.BroadleafCurrency savedCurrency -
orderService
protected org.broadleafcommerce.core.order.service.OrderService orderService -
extensionManager
-
orderLockManager
@Autowired @Qualifier("blOrderLockManager") protected org.broadleafcommerce.core.order.service.OrderLockManager orderLockManager
-
-
Constructor Details
-
UpdateCartServiceImpl
public UpdateCartServiceImpl()
-
-
Method Details
-
currencyHasChanged
public boolean currencyHasChanged()Description copied from interface:UpdateCartServiceCompares the currency set in the BroadleafRequestContext with the savedCurrency. If different, returns TRUE- Specified by:
currencyHasChangedin interfaceUpdateCartService- Returns:
-
copyCartToCurrentContext
public org.broadleafcommerce.core.order.service.call.UpdateCartResponse copyCartToCurrentContext(org.broadleafcommerce.core.order.domain.Order currentCart) Description copied from interface:UpdateCartServiceReprices the order by removing all items and recreating the cart calling for a reprice on the new cart.- Specified by:
copyCartToCurrentContextin interfaceUpdateCartService- Returns:
-
validateAddToCartRequest
public void validateAddToCartRequest(org.broadleafcommerce.core.order.service.call.OrderItemRequestDTO itemRequest, org.broadleafcommerce.core.order.domain.Order cart) Description copied from interface:UpdateCartServiceValidates the given add item that will be added to the given cart. This occurs prior to the item actually being added- Specified by:
validateAddToCartRequestin interfaceUpdateCartService
-
updateAndValidateCart
public void updateAndValidateCart(org.broadleafcommerce.core.order.domain.Order cart) Description copied from interface:UpdateCartServiceUpdates the cart (locale, pricing) and performs validation.- Specified by:
updateAndValidateCartin interfaceUpdateCartService
-
lockOrder
-
getErrorInsteadOfQueue
protected boolean getErrorInsteadOfQueue() -
findActiveCurrency
protected org.broadleafcommerce.common.currency.domain.BroadleafCurrency findActiveCurrency() -
checkAvailabilityInLocale
protected boolean checkAvailabilityInLocale(org.broadleafcommerce.core.order.domain.DiscreteOrderItem doi, org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency) -
getSavedCurrency
public org.broadleafcommerce.common.currency.domain.BroadleafCurrency getSavedCurrency()Description copied from interface:UpdateCartServiceGets the currency that was set as active on last pass through.- Specified by:
getSavedCurrencyin interfaceUpdateCartService- Returns:
-
setSavedCurrency
public void setSavedCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency savedCurrency) Description copied from interface:UpdateCartServiceSets the currency that was set as active on last pass through.- Specified by:
setSavedCurrencyin interfaceUpdateCartService
-