public class BroadleafCartController extends AbstractCartController
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ALL_PRODUCTS_ATTRIBUTE_NAME |
protected boolean |
automaticallyAddCompleteItems |
protected static String |
cartPageRedirect |
protected static String |
cartView |
protected static String |
checkoutView |
protected static String |
configurePageRedirect |
protected static String |
configureView |
catalogService, dtoTranslationService, offerService, orderItemService, orderService, updateCartService| Constructor and Description |
|---|
BroadleafCartController() |
| Modifier and Type | Method and Description |
|---|---|
String |
add(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
OrderItemRequestDTO itemRequest)
Takes in an item request, adds the item to the customer's current cart, and returns.
|
String |
addPromo(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String customerOffer)
Attempts to add provided Offer to Cart
|
String |
addWithPriceOverride(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
AddToCartItem itemRequest)
Deprecated.
|
String |
addWithPriceOverride(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
OrderItemRequestDTO itemRequest)
Takes in an item request, adds the item to the customer's current cart, and returns.
|
String |
cart(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model)
Renders the cart page.
|
String |
configure(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Long productId)
Takes a product id and builds out a dependant order item tree.
|
String |
empty(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model)
Cancels the current cart and redirects to the homepage
|
String |
getCartPageRedirect() |
String |
getCartView() |
String |
getCheckoutView() |
String |
getConfigurePageRedirect() |
String |
getConfigureView() |
Map<String,String> |
handleIllegalCartOpException(IllegalCartOperationException ex) |
protected boolean |
isCheckoutContext(javax.servlet.http.HttpServletRequest request) |
protected boolean |
isSafeToAdd(ConfigurableOrderItemRequest itemRequest) |
protected boolean |
isUpdateRequest(javax.servlet.http.HttpServletRequest request) |
String |
reconfigure(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Long orderItemId)
Takes an order item id and rebuilds the dependant order item tree with the current quantities and options set.
|
String |
remove(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
OrderItemRequestDTO itemRequest)
Takes in an item request, updates the quantity of that item in the cart, and returns
If the method was invoked via an AJAX call, it will render the "ajax/cart" template.
|
String |
removePromo(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Long offerCodeId)
Removes offer from cart
|
protected void |
updateAddRequestQuantities(OrderItemRequestDTO itemRequest,
Long originalOrderItemId) |
String |
updateQuantity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
AddToCartItem itemRequest)
Deprecated.
|
String |
updateQuantity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
OrderItemRequestDTO itemRequest)
Takes in an item request and updates the quantity of that item in the cart.
|
addDeepLink, getContextPath, isAjaxRequest, jsonResponseprotected static String cartView
protected static String checkoutView
protected static String cartPageRedirect
protected static String configureView
protected static String configurePageRedirect
protected static String ALL_PRODUCTS_ATTRIBUTE_NAME
@Value(value="${automatically.add.complete.items}")
protected boolean automaticallyAddCompleteItems
public String cart(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) throws PricingException
request - response - model - PricingExceptionpublic String add(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, OrderItemRequestDTO itemRequest) throws IOException, AddToCartException, PricingException, NumberFormatException, RemoveFromCartException, IllegalArgumentException
request - response - model - itemRequest - IOExceptionAddToCartExceptionPricingExceptionRemoveFromCartExceptionNumberFormatExceptionIllegalArgumentExceptionprotected void updateAddRequestQuantities(OrderItemRequestDTO itemRequest, Long originalOrderItemId)
protected boolean isUpdateRequest(javax.servlet.http.HttpServletRequest request)
public String addWithPriceOverride(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, OrderItemRequestDTO itemRequest) throws IOException, AddToCartException, PricingException
request - response - model - itemRequest - IOExceptionAddToCartExceptionPricingException@Deprecated public String addWithPriceOverride(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, AddToCartItem itemRequest) throws IOException, AddToCartException, PricingException
public String configure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Long productId) throws IOException, AddToCartException, PricingException, Exception
request - response - model - productId - IOExceptionAddToCartExceptionPricingExceptionExceptionpublic String reconfigure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Long orderItemId) throws IOException, AddToCartException, PricingException, Exception
request - response - model - orderItemId - IOExceptionAddToCartExceptionPricingExceptionExceptionpublic String updateQuantity(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, OrderItemRequestDTO itemRequest) throws IOException, UpdateCartException, PricingException, RemoveFromCartException
request - response - model - itemRequest - IOExceptionPricingExceptionUpdateCartExceptionRemoveFromCartException@Deprecated public String updateQuantity(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, AddToCartItem itemRequest) throws IOException, UpdateCartException, PricingException, RemoveFromCartException
public String remove(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, OrderItemRequestDTO itemRequest) throws IOException, PricingException, RemoveFromCartException
request - response - model - itemRequest - IOExceptionPricingExceptionRemoveFromCartExceptionpublic String empty(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) throws PricingException
request - response - model - PricingExceptionpublic String addPromo(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, String customerOffer) throws IOException, PricingException
request - response - model - customerOffer - IOExceptionPricingExceptionOfferMaxUseExceededExceptionprotected boolean isCheckoutContext(javax.servlet.http.HttpServletRequest request)
public String removePromo(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.Model model, Long offerCodeId) throws IOException, PricingException
request - response - model - IOExceptionPricingExceptionOfferMaxUseExceededExceptionpublic String getCartView()
public String getCartPageRedirect()
public String getConfigureView()
public String getConfigurePageRedirect()
public String getCheckoutView()
public Map<String,String> handleIllegalCartOpException(IllegalCartOperationException ex)
protected boolean isSafeToAdd(ConfigurableOrderItemRequest itemRequest)
Copyright © 2021. All rights reserved.