Class AddToCartController
java.lang.Object
de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
de.hybris.platform.b2ctelcoaddon.controllers.misc.AddToCartController
Controller for Add to Cart functionality which is not specific to a certain page.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
AbstractController.HttpNotFoundException -
Field Summary
FieldsFields inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
FORWARD_PREFIX, REDIRECT_PREFIX, ROOT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddBpoToCart(List<String> simpleProductOfferings, String processType, String rootBpoCode, int parentEntryNumber, String subscriptionTermId, String subscriberIdentity, String subscriberBillingId, org.springframework.ui.Model model) Adds multipleTmaSimpleProductOfferingModelentries to cart, as part of a bundle product offering specified by the given rootBpoCode.addpreConfig(String preConfig, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) addSpoToBpoConfiguration(String productCodePost, long qty, String processType, String rootBpoCode, String currentStep, int parentEntryNumber, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, String query, String page) Adds a newTmaSimpleProductOfferingModelentry to cart for the BPO.addSpoToCart(String productCodePost, String processType, long qty, String rootBpoCode, int parentEntryNumber, String subscriptionTermId, String subscriberIdentity, String subscriberBillingId, org.springframework.ui.Model model) Adds a newTmaSimpleProductOfferingModelentry to cart.protected de.hybris.platform.commercefacades.order.CartFacadeprotected EntryGroupFacadeprotected TmaProductFacadeprotected TmaProductOfferFacadeprotected TmaCartFacadeprotected TmaOrderEntryFacadeprotected TmaSubscriptionTermServicevoidinitBinder(org.springframework.web.bind.WebDataBinder binder) removeSpoFromJourneyStep(long entryNumber, String bpoCode, String groupId, String parentEntryNumber, org.springframework.ui.Model model, @Valid UpdateQuantityForm form, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) Removes the SPO added to the journey stepprotected voidsetCartFacade(de.hybris.platform.commercefacades.order.CartFacade cartFacade) voidsetEntryGroupFacade(EntryGroupFacade entryGroupFacade) voidsetTmaBpoPreConfigFacade(TmaBpoPreConfigFacade tmaBpoPreConfigFacade) voidsetTmaCartFacade(TmaCartFacade tmaCartFacade) Methods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
addRequestToModel, getBean
-
Field Details
-
SUCCESS
- See Also:
-
-
Constructor Details
-
AddToCartController
public AddToCartController()
-
-
Method Details
-
addSpoToCart
@RequestMapping(value="/cart/add", method=POST, produces="application/json") public String addSpoToCart(@RequestParam("productCodePost") String productCodePost, @RequestParam("processType") String processType, @RequestParam(value="qty",required=false,defaultValue="1") long qty, @RequestParam(value="rootBpoCode",required=false) String rootBpoCode, @RequestParam(value="parentEntryNumber",required=false,defaultValue="-1") int parentEntryNumber, @RequestParam(value="subscriptionTermId",required=false) String subscriptionTermId, @RequestParam(value="subscriberIdentity",required=false) String subscriberIdentity, @RequestParam(value="subscriberBillingId",required=false) String subscriberBillingId, org.springframework.ui.Model model) Adds a newTmaSimpleProductOfferingModelentry to cart. The entry can be added as a simple product offering, or also as part of a bundled product offering identified through the rootBpoCode parameter.- Parameters:
productCodePost-ProductModel.CODEprocessType- represents the process flow in the context of which the entry is added to cart (Acquisition, Retention, etc.)qty- quantity to be added;default value is 1rootBpoCode-ProductModel.CODEof the root Bundled Product Offering, as part of which theTmaSimpleProductOfferingModelis addedparentEntryNumber- specifies the identifier of the cart entry serving as parent for the entry to be added toosubscriptionTermId- specifies the identifier of the new subscription termsubscriberIdentity- represents subscriber identity for an existing customersubscriberBillingId- represents subscriber billing system id for an existing customermodel- the Spring model- Returns:
- the path for AddToCart popup showing the new added entries
-
addBpoToCart
@RequestMapping(value="/cart/addBpo", method=POST) public String addBpoToCart(@RequestParam("simpleProductOfferings") List<String> simpleProductOfferings, @RequestParam("processType") String processType, @RequestParam("rootBpoCode") String rootBpoCode, @RequestParam(value="parentEntryNumber",required=false,defaultValue="-1") int parentEntryNumber, @RequestParam(value="subscriptionTermId",required=false) String subscriptionTermId, @RequestParam(value="subscriberIdentity",required=false) String subscriberIdentity, @RequestParam(value="subscriberBillingId",required=false) String subscriberBillingId, org.springframework.ui.Model model) Adds multipleTmaSimpleProductOfferingModelentries to cart, as part of a bundle product offering specified by the given rootBpoCode. The entries can be added under an existing cart entries group indicated by the cartGroupNo parameter, or under a new entry group .- Parameters:
simpleProductOfferings- a list ofProductModel.CODEprocessType- represents the process flow in the context of which the entry is added to cart (Acquisition, Retention, etc.)rootBpoCode-ProductModel.CODEof the root Bundled Product Offering, as part of which theTmaSimpleProductOfferingModelare addedparentEntryNumber- specifies the identifier of the cart entry serving as parent for the new entries to be added to cartmodel- the Spring model- Returns:
- the link to cart page
-
addSpoToBpoConfiguration
@RequestMapping(value="/cart/addSpo", method=POST, produces="application/json") public String addSpoToBpoConfiguration(@RequestParam("productCodePost") String productCodePost, @RequestParam(value="qty",required=false,defaultValue="1") long qty, @RequestParam("processType") String processType, @RequestParam("rootBpoCode") String rootBpoCode, @RequestParam(value="currentStep",required=false) String currentStep, @RequestParam(value="parentEntryNumber",required=false,defaultValue="-1") int parentEntryNumber, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, @RequestParam(value="q",required=false) String query, @RequestParam(value="page",required=false) String page) Adds a newTmaSimpleProductOfferingModelentry to cart for the BPO. The entry can be added as a simple product offering as a part of a bundled product offering identified through the rootBpoCode parameter and group number if any- Parameters:
productCodePost-ProductModel.CODEqty- quantity to be added;default value is 1processType- represents the process flow in the context of which the entry is added to cart (Acquisition, Retention, etc.)rootBpoCode-ProductModel.CODEof the root Bundled Product Offering, as part of which theTmaSimpleProductOfferingModelis addedcurrentStep- Step id or the group Id from where the SPO is added to the BPOparentEntryNumber- specifies the identifier of the cart entry serving as parent for the new entry to be added toomodel- the Spring modelquery- The applied query on pagepage- The page number from which the product is added to the cart- Returns:
- the path for bpo guided selling for the group appended with the group number
-
removeSpoFromJourneyStep
@RequestMapping(value="/cart/removeSpo", method=POST) public String removeSpoFromJourneyStep(@RequestParam("entryNumber") long entryNumber, @RequestParam("bpoCode") String bpoCode, @RequestParam("groupId") String groupId, @RequestParam("parentEntryNumber") String parentEntryNumber, org.springframework.ui.Model model, @Valid @Valid UpdateQuantityForm form, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel) Removes the SPO added to the journey step- Parameters:
entryNumber- entry number of the cart entry to be updatedgroupId- The groupId of the journeybpoCode- The parent BPO code for the journeyparentEntryNumber- specifies the identifier of the parent entry where the entry is to be removed frommodel- page model to be populated with informationform- update quantity form specifying the new quantity of the product from the entry with the number givenbindingResult- request binding result to retrieve validation errors fromredirectModel- redirect model to be populated with information- Returns:
- redirect url to the journey page
-
addpreConfig
-
getCartFacade
protected de.hybris.platform.commercefacades.order.CartFacade getCartFacade() -
setCartFacade
protected void setCartFacade(de.hybris.platform.commercefacades.order.CartFacade cartFacade) -
getProductFacade
-
getTmaCartFacade
-
setTmaCartFacade
-
getEntryGroupFacade
-
setEntryGroupFacade
-
getTmaBpoPreConfigFacade
-
setTmaBpoPreConfigFacade
-
getCustomerFacade
-
getTmaOrderEntryFacade
-
getProductOfferFacade
-
getTmaSubscriptionTermService
-
initBinder
@InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder)
-