|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.elasticpath.sfweb.ajax.service.impl.ShoppingCartAjaxControllerImpl
public class ShoppingCartAjaxControllerImpl
The default implementation of the ShoppingCartAjaxController.
Constructor Summary | |
---|---|
ShoppingCartAjaxControllerImpl()
|
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. |
void |
setShoppingCartService(ShoppingCartService shoppingCartService)
Sets the shopping cart service. |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShoppingCartAjaxControllerImpl()
Method Detail |
---|
public ShoppingCart calculateForSelectedShippingServiceLevel(long selectedShippingServiceLevelUid, javax.servlet.http.HttpServletRequest request)
calculateForSelectedShippingServiceLevel
in interface ShoppingCartAjaxController
selectedShippingServiceLevelUid
- - the uid of the selected shipping service level.request
- - the current HttpServletRequest.
public ShoppingCartBean calculateShipping(long selectedShippingServiceLevelUid, javax.servlet.http.HttpServletRequest request)
calculateShipping
in interface ShoppingCartAjaxController
selectedShippingServiceLevelUid
- - the uid of the selected shipping service level.request
- - the current HttpServletRequest.
ShoppingCartBean
.public ShoppingCart changeEstimationAddress(javax.servlet.http.HttpServletRequest request)
changeEstimationAddress
in interface ShoppingCartAjaxController
request
- - the current HttpServletRequest.
public ShoppingCart estimateShippingAndTaxes(java.lang.String countryCode, java.lang.String subCountryCode, java.lang.String zipOrPostalCode, java.util.List cartItemQtyList, javax.servlet.http.HttpServletRequest request)
estimateShippingAndTaxes
in interface ShoppingCartAjaxController
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.
public ShoppingCart getCart(javax.servlet.http.HttpServletRequest request)
getCart
in interface ShoppingCartAjaxController
request
- the current request (filled in automatically by dwr)
public ShoppingCartBean getCartBean(javax.servlet.http.HttpServletRequest request)
ShoppingCartBean
wrapper.
getCartBean
in interface ShoppingCartAjaxController
request
- the current HttpServletRequest
ShoppingCartBean
wrapper objectpublic java.util.List getCartItemPrices(javax.servlet.http.HttpServletRequest request)
getCartItemPrices
in interface ShoppingCartAjaxController
request
- - the current HttpServletRequest.
public java.lang.String getEstimateAddressStr(javax.servlet.http.HttpServletRequest request)
getEstimateAddressStr
in interface ShoppingCartAjaxController
request
- - the current HttpServletRequest.
public ShoppingCartBean removeCartItem(long itemUid, javax.servlet.http.HttpServletRequest request)
removeCartItem
in interface ShoppingCartAjaxController
itemUid
- the uidPk of the CartItem
to removerequest
- the current HttpServletRequest
ShoppingCartBean
objectpublic void setCheckoutService(CheckoutService checkoutService)
setCheckoutService
in interface ShoppingCartAjaxController
checkoutService
- the checkout servicepublic void setOnePageHelper(OnePageHelper onePageHelper)
setOnePageHelper
in interface ShoppingCartAjaxController
onePageHelper
- the onePageHelper to setpublic void setProductService(ProductService productService)
setProductService
in interface ShoppingCartAjaxController
productService
- the productService to setpublic ShoppingCartBean setPromotionCode(java.lang.String promotionCode, javax.servlet.http.HttpServletRequest request) throws DwrValidationException
setPromotionCode
in interface ShoppingCartAjaxController
promotionCode
- the promotion code to applyrequest
- the current HttpServletRequest
ShoppingCartBean
object
DwrValidationException
- if the promotion code is not acceptedpublic void setRequestHelper(RequestHelper requestHelper)
setRequestHelper
in interface ShoppingCartAjaxController
requestHelper
- the request helper.public ShoppingCartBean setShippingServiceLevel(long selectedShippingServiceLevelUid, javax.servlet.http.HttpServletRequest request)
setShippingServiceLevel
in interface ShoppingCartAjaxController
selectedShippingServiceLevelUid
- - the uid of the selected shipping service level.request
- - the current HttpServletRequest.
public void setShoppingCartService(ShoppingCartService shoppingCartService)
shoppingCartService
- the shopping cart servicepublic ShoppingCartBean updateCartItemById(long uidPk, java.lang.String guid, int quantity, javax.servlet.http.HttpServletRequest request) throws DwrValidationException
updateCartItemById
in interface ShoppingCartAjaxController
uidPk
- the id of the cart itemguid
- the guid of the product skuquantity
- the new quantityrequest
- the current request (filled in automatically by dwr)
ShoppingCart
object and cart items wrapped in a ShoppingCartBean
object
DwrValidationException
- the map of field names to error messages
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |