Class CartsController


  • @Controller
    @RequestMapping("/{baseSiteId}/users/{userId}/carts")
    public class CartsController
    extends BaseCommerceController
    • Constructor Detail

      • CartsController

        public CartsController()
    • Method Detail

      • getCartEntryForNumber

        protected static OrderEntryData getCartEntryForNumber​(CartData cart,
                                                              long number)
      • getCartEntry

        protected static OrderEntryData getCartEntry​(CartData cart,
                                                     java.lang.String productCode,
                                                     java.lang.String pickupStore)
      • validateForAmbiguousPositions

        protected static void validateForAmbiguousPositions​(CartData currentCart,
                                                            OrderEntryData currentEntry,
                                                            java.lang.String newPickupStore)
      • getCarts

        @RequestMapping(method=GET)
        @ResponseBody
        public CartListWsDTO getCarts​(@RequestParam(defaultValue="DEFAULT")
                                      java.lang.String fields,
                                      @RequestParam(defaultValue="false")
                                      boolean savedCartsOnly,
                                      @RequestParam(defaultValue="0")
                                      int currentPage,
                                      @RequestParam(defaultValue="20")
                                      int pageSize,
                                      @RequestParam(required=false)
                                      java.lang.String sort)
      • getCart

        @RequestMapping(value="/{cartId}",
                        method=GET)
        @ResponseBody
        public CartWsDTO getCart​(@RequestParam(defaultValue="DEFAULT")
                                 java.lang.String fields)
      • createCart

        @RequestMapping(method=POST)
        @ResponseStatus(CREATED)
        @ResponseBody
        public CartWsDTO createCart​(@RequestParam(required=false)
                                    java.lang.String oldCartId,
                                    @RequestParam(required=false)
                                    java.lang.String toMergeCartGuid,
                                    @RequestParam(defaultValue="DEFAULT")
                                    java.lang.String fields)
      • isUserCart

        protected boolean isUserCart​(java.lang.String toMergeCartGuid)
      • isCartAnonymous

        protected boolean isCartAnonymous​(java.lang.String cartGuid)
      • removeCart

        @RequestMapping(value="/{cartId}",
                        method=DELETE)
        @ResponseStatus(OK)
        public void removeCart()
      • replaceCartGuestUser

        @Secured({"ROLE_CLIENT","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/email",
                        method=PUT)
        @ResponseStatus(OK)
        public void replaceCartGuestUser​(@RequestParam
                                         java.lang.String email)
                                  throws DuplicateUidException
        Throws:
        DuplicateUidException
      • getCartEntries

        @RequestMapping(value="/{cartId}/entries",
                        method=GET)
        @ResponseBody
        public OrderEntryListWsDTO getCartEntries​(@RequestParam(defaultValue="DEFAULT")
                                                  java.lang.String fields)
      • getCartEntry

        @RequestMapping(value="/{cartId}/entries/{entryNumber}",
                        method=GET)
        @ResponseBody
        public OrderEntryWsDTO getCartEntry​(@PathVariable
                                            long entryNumber,
                                            @RequestParam(defaultValue="DEFAULT")
                                            java.lang.String fields)
      • createCartDeliveryAddress

        @Deprecated(since="1905",
                    forRemoval=true)
        @Secured({"ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_GUEST","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/addresses/delivery",
                        method=POST)
        @ResponseStatus(CREATED)
        @ResponseBody
        public AddressWsDTO createCartDeliveryAddress​(javax.servlet.http.HttpServletRequest request,
                                                      @RequestParam(defaultValue="DEFAULT")
                                                      java.lang.String fields)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 2005. Please use createCartDeliveryAddress(AddressWsDTO, String) instead.
      • createCartDeliveryAddress

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_GUEST","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/addresses/delivery",
                        method=POST,
                        consumes={"application/json","application/xml"})
        @ResponseStatus(CREATED)
        @ResponseBody
        public AddressWsDTO createCartDeliveryAddress​(@RequestBody
                                                      AddressWsDTO address,
                                                      @RequestParam(defaultValue="DEFAULT")
                                                      java.lang.String fields)
      • replaceCartDeliveryAddress

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/addresses/delivery",
                        method=PUT)
        @ResponseStatus(OK)
        @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2c.channels")
        public void replaceCartDeliveryAddress​(@RequestParam
                                               java.lang.String addressId)
      • removeCartDeliveryAddress

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/addresses/delivery",
                        method=DELETE)
        @ResponseStatus(OK)
        public void removeCartDeliveryAddress()
      • getCartDeliveryMode

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/deliverymode",
                        method=GET)
        @ResponseBody
        public DeliveryModeWsDTO getCartDeliveryMode​(@RequestParam(defaultValue="DEFAULT")
                                                     java.lang.String fields)
      • replaceCartDeliveryMode

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/deliverymode",
                        method=PUT)
        @ResponseStatus(OK)
        public void replaceCartDeliveryMode​(@RequestParam(required=true)
                                            java.lang.String deliveryModeId)
                                     throws UnsupportedDeliveryModeException
        Throws:
        UnsupportedDeliveryModeException
      • removeCartDeliveryMode

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/deliverymode",
                        method=DELETE)
        @ResponseStatus(OK)
        public void removeCartDeliveryMode()
      • getCartDeliveryModes

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/deliverymodes",
                        method=GET)
        @ResponseBody
        public DeliveryModeListWsDTO getCartDeliveryModes​(@RequestParam(defaultValue="DEFAULT")
                                                          java.lang.String fields)
      • replaceCartPaymentDetails

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/paymentdetails",
                        method=PUT)
        @ResponseStatus(OK)
        public void replaceCartPaymentDetails​(@RequestParam
                                              java.lang.String paymentDetailsId)
                                       throws InvalidPaymentInfoException
        Throws:
        InvalidPaymentInfoException
      • getCartPromotions

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/promotions",
                        method=GET)
        @ResponseBody
        public PromotionResultListWsDTO getCartPromotions​(@RequestParam(required=false,defaultValue="DEFAULT")
                                                          java.lang.String fields)
      • getCartPromotion

        @Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"})
        @RequestMapping(value="/{cartId}/promotions/{promotionId}",
                        method=GET)
        @ResponseBody
        public PromotionResultListWsDTO getCartPromotion​(@PathVariable
                                                         java.lang.String promotionId,
                                                         @RequestParam(defaultValue="DEFAULT")
                                                         java.lang.String fields)
      • getCartVouchers

        @Secured({"ROLE_CLIENT","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT","ROLE_GUEST"})
        @RequestMapping(value="/{cartId}/vouchers",
                        method=GET)
        @ResponseBody
        public VoucherListWsDTO getCartVouchers​(@RequestParam(defaultValue="DEFAULT")
                                                java.lang.String fields)
      • validateIfProductIsInStockInPOS

        protected void validateIfProductIsInStockInPOS​(java.lang.String baseSiteId,
                                                       java.lang.String productCode,
                                                       java.lang.String storeName,
                                                       java.lang.Long entryNumber)
      • validateIfProductIsInStockOnline

        protected void validateIfProductIsInStockOnline​(java.lang.String baseSiteId,
                                                        java.lang.String productCode,
                                                        java.lang.Long entryNumber)