com.elasticpath.sfweb.ajax.service
Interface ShoppingCartAjaxController

All Known Implementing Classes:
ShoppingCartAjaxControllerImpl

public interface ShoppingCartAjaxController

Provides shopping cart related services for ajax.


Method Summary
 ShoppingCart calculateForSelectedShippingServiceLevel(long selectedShippingServiceLevelUid, javax.servlet.http.HttpServletRequest request)
          Calculate shopping cart with the selected shipping service level.
 ShoppingCartBean calculateShipping(long selectedShippingServiceLevelUid, javax.servlet.http.HttpServletRequest request)
          Calculate shopping cart with the selected shipping service level.
 ShoppingCart changeEstimationAddress(javax.servlet.http.HttpServletRequest request)
          Prepare to reset the address for shipping/taxed.
 ShoppingCart estimateShippingAndTaxes(java.lang.String countryCode, java.lang.String subCountryCode, java.lang.String zipOrPostalCode, java.util.List cartItemQtyList, javax.servlet.http.HttpServletRequest request)
          Estimate the shipping options and taxes for the session shopping cart, based on the given countryCode, subCountryCode and zipOrPostalCode.
 ShoppingCart getCart(javax.servlet.http.HttpServletRequest request)
          Method for retreiving the shopping cart through dwr.
 ShoppingCartBean getCartBean(javax.servlet.http.HttpServletRequest request)
          Retrieve the ShoppingCartBean wrapper.
 java.util.List getCartItemPrices(javax.servlet.http.HttpServletRequest request)
          Retieve the INDEPENDENT shopping cart item prices.
 java.lang.String getEstimateAddressStr(javax.servlet.http.HttpServletRequest request)
          Return the string representation of the address bits entered for shipping and tax estimation.
 ShoppingCartBean removeCartItem(long itemUid, javax.servlet.http.HttpServletRequest request)
          Remove an item from the cart.
 void setCheckoutService(CheckoutService checkoutService)
          Set the checkout service for processing a checkout.
 void setOnePageHelper(OnePageHelper onePageHelper)
           
 void setProductService(ProductService productService)
           
 ShoppingCartBean setPromotionCode(java.lang.String promotionCode, javax.servlet.http.HttpServletRequest request)
          Attempts to apply a given promotion code to the shopping cart.
 void setRequestHelper(RequestHelper requestHelper)
          Set the request helper.
 ShoppingCartBean setShippingServiceLevel(long selectedShippingServiceLevelUid, javax.servlet.http.HttpServletRequest request)
          Calculate shopping cart with the selected shipping service level.
 ShoppingCartBean updateCartItemById(long uidPk, java.lang.String guid, int quantity, javax.servlet.http.HttpServletRequest request)
          Handles validation of cart item, such as inventory checks, for dwr before updating.
 

Method Detail

calculateForSelectedShippingServiceLevel

ShoppingCart calculateForSelectedShippingServiceLevel(long selectedShippingServiceLevelUid,
                                                      javax.servlet.http.HttpServletRequest request)
Calculate shopping cart with the selected shipping service level.

Parameters:
selectedShippingServiceLevelUid - - the uid of the selected shipping service level.
request - - the current HttpServletRequest.
Returns:
the updated shopping cart.

calculateShipping

ShoppingCartBean calculateShipping(long selectedShippingServiceLevelUid,
                                   javax.servlet.http.HttpServletRequest request)
Calculate shopping cart with the selected shipping service level.

Parameters:
selectedShippingServiceLevelUid - - the uid of the selected shipping service level.
request - - the current HttpServletRequest.
Returns:
the updated ShoppingCartBean.

changeEstimationAddress

ShoppingCart changeEstimationAddress(javax.servlet.http.HttpServletRequest request)
Prepare to reset the address for shipping/taxed.

Parameters:
request - - the current HttpServletRequest.
Returns:
the updated shopping cart.

estimateShippingAndTaxes

ShoppingCart estimateShippingAndTaxes(java.lang.String countryCode,
                                      java.lang.String subCountryCode,
                                      java.lang.String zipOrPostalCode,
                                      java.util.List cartItemQtyList,
                                      javax.servlet.http.HttpServletRequest request)
Estimate the shipping options and taxes for the session shopping cart, based on the given countryCode, subCountryCode and zipOrPostalCode. The session shopping cart shoud be updated afterwards.

Parameters:
countryCode - - the selected country code for the shipping options and taxes estimation.
subCountryCode - - the selected subCountry code for the shipping options and taxes estimation.
zipOrPostalCode - - the zip or postal code for the shipping options and taxes estimation.
cartItemQtyList - - the list of cart item qty.
request - - the current HttpServletRequest.
Returns:
the updated shopping cart.

getCart

ShoppingCart getCart(javax.servlet.http.HttpServletRequest request)
Method for retreiving the shopping cart through dwr.

Parameters:
request - the current request (filled in automatically by dwr)
Returns:
the shopping cart object

getCartBean

ShoppingCartBean getCartBean(javax.servlet.http.HttpServletRequest request)
Retrieve the ShoppingCartBean wrapper.

Parameters:
request - the current HttpServletRequest
Returns:
the ShoppingCartBean wrapper object

getCartItemPrices

java.util.List getCartItemPrices(javax.servlet.http.HttpServletRequest request)
Retieve the INDEPENDENT shopping cart item prices.

Parameters:
request - - the current HttpServletRequest.
Returns:
the list of cart item prices.

getEstimateAddressStr

java.lang.String getEstimateAddressStr(javax.servlet.http.HttpServletRequest request)
Return the string representation of the address bits entered for shipping and tax estimation.

Parameters:
request - - the current HttpServletRequest.
Returns:
the string representation of the address.

removeCartItem

ShoppingCartBean removeCartItem(long itemUid,
                                javax.servlet.http.HttpServletRequest request)
Remove an item from the cart.

Parameters:
itemUid - the uidPk of the CartItem to remove
request - the current HttpServletRequest
Returns:
the modified ShoppingCart object

setCheckoutService

void setCheckoutService(CheckoutService checkoutService)
Set the checkout service for processing a checkout.

Parameters:
checkoutService - the checkout service

setOnePageHelper

void setOnePageHelper(OnePageHelper onePageHelper)
Parameters:
onePageHelper - the onePageHelper to set

setProductService

void setProductService(ProductService productService)
Parameters:
productService - the productService to set

setPromotionCode

ShoppingCartBean setPromotionCode(java.lang.String promotionCode,
                                  javax.servlet.http.HttpServletRequest request)
Attempts to apply a given promotion code to the shopping cart.

Parameters:
promotionCode - the promotion code to apply
request - the current HttpServletRequest
Returns:
the updated ShoppingCartBean object

setRequestHelper

void setRequestHelper(RequestHelper requestHelper)
Set the request helper.

Parameters:
requestHelper - the request helper.

setShippingServiceLevel

ShoppingCartBean setShippingServiceLevel(long selectedShippingServiceLevelUid,
                                         javax.servlet.http.HttpServletRequest request)
Calculate shopping cart with the selected shipping service level.

Parameters:
selectedShippingServiceLevelUid - - the uid of the selected shipping service level.
request - - the current HttpServletRequest.
Returns:
the updated shopping cart ajax bean.

updateCartItemById

ShoppingCartBean updateCartItemById(long uidPk,
                                    java.lang.String guid,
                                    int quantity,
                                    javax.servlet.http.HttpServletRequest request)
Handles validation of cart item, such as inventory checks, for dwr before updating.

Parameters:
uidPk - the id of the cart item
guid - the guid of the product sku
quantity - the new quantity
request - the current request (filled in automatically by dwr)
Returns:
the updated shopping cart object