Class AddToCartController

java.lang.Object
de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
de.hybris.platform.traveladdon.controllers.misc.AddToCartController

@Controller public class AddToCartController extends AbstractController
Controller for Add to Cart functionality which is not specific to a certain page.
  • Field Details

  • Constructor Details

    • AddToCartController

      public AddToCartController()
  • Method Details

    • addToCart

      @RequestMapping(value="/cart/add", method=POST, produces="application/json") @ResponseBody public AddToCartResponseData addToCart(AddToCartForm addToCartForm, org.springframework.ui.Model model)
      Parameters:
      addToCartForm -
      model -
      Returns:
      String
    • performAddToCart

      protected boolean performAddToCart(AddToCartForm addToCartForm, org.springframework.ui.Model model)
      Perform add to cart.
      Parameters:
      addToCartForm - the add to cart form
      model - the model
      Returns:
      true, if successful
    • addToCart

      @RequestMapping(value="/cart/add/group", method=POST, consumes="application/json", produces="application/json") @ResponseBody public AddToCartResponseData addToCart(@RequestBody List<AddToCartForm> addToCartForms, org.springframework.ui.Model model)
      Adds the to cart.
      Parameters:
      addToCartForms - the add to cart forms
      model - the model
      Returns:
      the string
    • upgradeBundleInCart

      @RequestMapping(value="/cart/upgradeBundle", method=POST) public String upgradeBundleInCart(@ModelAttribute("addBundleToCartForm") AddBundleToCartForm addBundleToCartForm, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
    • getUpgradeBundleErrorMessage

      protected String getUpgradeBundleErrorMessage(String errorMsg, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
    • createAddToCartResponse

      protected AddToCartResponseData createAddToCartResponse(boolean valid, String errorMessage, Integer minOriginDestinationRefNumber)
      Creates an AddToCartResponseData
      Parameters:
      valid -
      errorMessage -
      minOriginDestinationRefNumber -
      Returns:
      the AddToCartResponseData
    • addToCartBundle

      @RequestMapping(value="/cart/addBundle", method=POST, produces="application/json") @ResponseBody public AddToCartResponseData addToCartBundle(@ModelAttribute("addBundleToCartForm") AddBundleToCartForm addBundleToCartForm, org.springframework.ui.Model model)
      Performs the addBundleToCart for the given addBundleToCartForm and returns the name of the jsp that builds the JSON response.
      Parameters:
      addBundleToCartForm - the addBundleToCartForm
      model - the model
      Returns:
      String the name of the jsp that builds the JSON response.
    • addBundleToCart

      protected String addBundleToCart(AddBundleToCartRequestData addBundleToCartRequestData)
      Performs the addBundleToCart for the given addBundleToCartRequestData.
      Parameters:
      addBundleToCartRequestData - as the addBundleToCartRequestData
      Returns:
      a string representing the error message if the addToCartBundle was unsuccessful, an empty string otherwise
    • getAddBundleToCartRequestData

      protected AddBundleToCartRequestData getAddBundleToCartRequestData(AddBundleToCartForm addBundleToCartForm)
      Returns the AddBundleToCartRequestData built from the AddBundleToCartForm.
      Parameters:
      addBundleToCartForm - as the addBundleToCartForm
      Returns:
      the AddBundleToCartRequestData
    • addTransportBundleToCart

      @RequestMapping(value="/cart/add-transport-bundle", method=POST, produces="application/json") @ResponseBody public AddToCartResponseData addTransportBundleToCart(AddBundleToCartForm addBundleToCartForm, org.springframework.ui.Model model)
      Performs the addTransportBundleToCart for the given addBundleToCartForm and returns the name of the jsp that builds the JSON response.
      Parameters:
      addBundleToCartForm - the addBundleToCartForm
      model - the model
      Returns:
      String the name of the jsp that builds the JSON response.
    • changeTransportBundle

      @RequestMapping(value="/cart/package-change-transport", method=POST, produces="application/json") @ResponseBody public AddToCartResponseData changeTransportBundle(AddBundleToCartForm addBundleToCartForm, org.springframework.ui.Model model)
      Removes all cart entries for specific origin destination ref number and adds a newly selected bundle to cart for the same origin destination.
      Parameters:
      addBundleToCartForm - the addBundleToCartForm
      model - the model
      Returns:
      String the name of the jsp that builds the JSON response.
    • updateAddToCartResponseDataErrorMessage

      protected void updateAddToCartResponseDataErrorMessage(AddToCartResponseData response)
    • addSelectedAccommodationsToCart

      @RequestMapping(value={"/cart/addremove/accommodations","/manage-booking/ancillary/cart/addremove/accommodations"}, method={POST,GET}, consumes="application/json", produces="application/json") @ResponseBody public AddToCartResponseData addSelectedAccommodationsToCart(@RequestBody List<AddRemoveAccommodation> addRemoveAccommodations, org.springframework.ui.Model model)
      Adds the selected accommodations to cart.
      Parameters:
      addRemoveAccommodations - the add remove accommodations
      model - the model
      Returns:
      the string
    • addPropertiesToCartEntry

      protected void addPropertiesToCartEntry(String travellerCode, int originDestinationRefNo, String travelRoute, List<String> transportOfferingCodes, Boolean active, AmendStatus amendStatus, CartModificationData cartModification)
      Adds the properties to cart entry.
      Parameters:
      travellerCode - the traveller code
      originDestinationRefNo - the origin destination ref no
      travelRoute - the travel route
      transportOfferingCodes - the transport offering codes
      active - the active
      amendStatus - the amend status
      cartModification - the cart modification
    • redeemVoucher

      @RequestMapping(value="/cart/voucher/redeem", method=POST) @ResponseBody public Map<String,String> redeemVoucher(@RequestParam("voucherCode") String voucherCode)
      Method to add voucher to cart
      Parameters:
      voucherCode -
      Returns:
      map
    • releaseVoucher

      @RequestMapping(value="/cart/voucher/release", method=POST) @ResponseBody public Map<String,String> releaseVoucher(@RequestParam("voucherCode") String voucherCode)
      Method to remove voucher from cart
      Parameters:
      voucherCode -
      Returns:
      map
    • getCartFacade

      protected TravelCartFacade getCartFacade()
      Returns:
      TravelCartFacade
    • setCartFacade

      public void setCartFacade(TravelCartFacade cartFacade)
      Parameters:
      cartFacade -
    • getTravellerFacade

      protected TravellerFacade getTravellerFacade()
      Returns:
      TravellerFacade
    • setTravellerFacade

      public void setTravellerFacade(TravellerFacade travellerFacade)
      Parameters:
      travellerFacade -
    • getL10NService

      protected de.hybris.platform.servicelayer.i18n.L10NService getL10NService()
      Returns:
      L10NService
    • setL10NService

      public void setL10NService(de.hybris.platform.servicelayer.i18n.L10NService l10nService)
      Parameters:
      l10nService -
    • getTravelRestrictionStrategy

      protected TravelRestrictionStrategy getTravelRestrictionStrategy()
      Returns:
      TravelRestrictionStrategy
    • setTravelRestrictionStrategy

      public void setTravelRestrictionStrategy(TravelRestrictionStrategy travelRestrictionStrategy)
      Parameters:
      travelRestrictionStrategy -
    • getAddAccommodationToCartStrategy

      protected AddAccommodationToCartStrategy getAddAccommodationToCartStrategy()
      Returns:
      AddAccommodationToCartStrategy
    • setAddAccommodationToCartStrategy

      public void setAddAccommodationToCartStrategy(AddAccommodationToCartStrategy addAccommodationToCartStrategy)
      Parameters:
      addAccommodationToCartStrategy -
    • getConfiguredAccommodationFacade

      protected ConfiguredAccommodationFacade getConfiguredAccommodationFacade()
      Returns:
      ConfiguredAccommodationFacade
    • setConfiguredAccommodationFacade

      public void setConfiguredAccommodationFacade(ConfiguredAccommodationFacade configuredAccommodationFacade)
      Parameters:
      configuredAccommodationFacade -