Interface UpdateCartService
- All Known Implementing Classes:
UpdateCartServiceImpl
public interface UpdateCartService
Provides methods to facilitate order repricing.
Author: jerryocanas Date: 9/26/12
-
Method Summary
Modifier and TypeMethodDescriptionorg.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.org.broadleafcommerce.common.currency.domain.BroadleafCurrencyGets the currency that was set as active on last pass through.voidsetSavedCurrency(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.
-
Method Details
-
getSavedCurrency
org.broadleafcommerce.common.currency.domain.BroadleafCurrency getSavedCurrency()Gets the currency that was set as active on last pass through.- Returns:
-
setSavedCurrency
void setSavedCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency savedCurrency) Sets the currency that was set as active on last pass through.- Parameters:
savedCurrency-
-
currencyHasChanged
boolean currencyHasChanged()Compares the currency set in the BroadleafRequestContext with the savedCurrency. If different, returns TRUE- Returns:
-
copyCartToCurrentContext
org.broadleafcommerce.core.order.service.call.UpdateCartResponse copyCartToCurrentContext(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.- Returns:
-
validateAddToCartRequest
void validateAddToCartRequest(org.broadleafcommerce.core.order.service.call.OrderItemRequestDTO itemRequest, org.broadleafcommerce.core.order.domain.Order cart) throws IllegalArgumentException Validates the given add item that will be added to the given cart. This occurs prior to the item actually being added- Parameters:
cart-- Throws:
IllegalArgumentException
-
updateAndValidateCart
void updateAndValidateCart(org.broadleafcommerce.core.order.domain.Order cart) Updates the cart (locale, pricing) and performs validation.- Parameters:
cart-- Throws:
IllegalArgumentException
-