Class ShoppingCart

    • Field Detail

      • module

        public static final java.lang.String module
      • scale

        public static final int scale
      • rounding

        public static final java.math.RoundingMode rounding
      • taxCalcScale

        public static final int taxCalcScale
      • taxFinalScale

        public static final int taxFinalScale
      • taxRounding

        public static final java.math.RoundingMode taxRounding
      • generalRounding

        public static final java.math.MathContext generalRounding
      • nextGroupNumber

        protected long nextGroupNumber
      • productStoreId

        protected java.lang.String productStoreId
      • doPromotions

        protected boolean doPromotions
      • transactionId

        protected java.lang.String transactionId
      • facilityId

        protected java.lang.String facilityId
      • webSiteId

        protected java.lang.String webSiteId
      • terminalId

        protected java.lang.String terminalId
      • autoOrderShoppingListId

        protected java.lang.String autoOrderShoppingListId
      • orderPartyId

        protected java.lang.String orderPartyId
        General partyId for the Order, all other IDs default to this one if not specified explicitly
      • placingCustomerPartyId

        protected java.lang.String placingCustomerPartyId
      • billToCustomerPartyId

        protected java.lang.String billToCustomerPartyId
      • shipToCustomerPartyId

        protected java.lang.String shipToCustomerPartyId
      • endUserCustomerPartyId

        protected java.lang.String endUserCustomerPartyId
      • billFromVendorPartyId

        protected java.lang.String billFromVendorPartyId
      • shipFromVendorPartyId

        protected java.lang.String shipFromVendorPartyId
      • supplierAgentPartyId

        protected java.lang.String supplierAgentPartyId
      • locale

        protected java.util.Locale locale
      • currencyUom

        protected java.lang.String currencyUom
      • holdOrder

        protected boolean holdOrder
      • orderDate

        protected java.sql.Timestamp orderDate
      • cancelBackOrderDate

        protected java.sql.Timestamp cancelBackOrderDate
    • Constructor Detail

      • ShoppingCart

        protected ShoppingCart()
        don't allow empty constructor
      • ShoppingCart

        public ShoppingCart​(ShoppingCart cart)
        Creates a new cloned ShoppingCart Object.
      • ShoppingCart

        public ShoppingCart​(Delegator delegator,
                            java.lang.String productStoreId,
                            java.lang.String webSiteId,
                            java.util.Locale locale,
                            java.lang.String currencyUom,
                            java.lang.String billToCustomerPartyId,
                            java.lang.String billFromVendorPartyId)
        Creates new empty ShoppingCart object.
      • ShoppingCart

        public ShoppingCart​(Delegator delegator,
                            java.lang.String productStoreId,
                            java.lang.String webSiteId,
                            java.util.Locale locale,
                            java.lang.String currencyUom)
        Creates new empty ShoppingCart object.
      • ShoppingCart

        public ShoppingCart​(Delegator delegator,
                            java.lang.String productStoreId,
                            java.util.Locale locale,
                            java.lang.String currencyUom)
        Creates a new empty ShoppingCart object.
    • Method Detail

      • getDelegator

        public Delegator getDelegator()
      • getProductStoreId

        public java.lang.String getProductStoreId()
      • getDoPromotions

        public boolean getDoPromotions()
      • setDoPromotions

        public void setDoPromotions​(boolean doPromotions)
      • setProductStoreId

        public void setProductStoreId​(java.lang.String productStoreId)
        This is somewhat of a dangerous method, changing the productStoreId changes a lot of stuff including: - some items in the cart may not be valid in any catalog in the new store - promotions need to be recalculated for the products that remain - what else? lots of settings on the ProductStore... So for now this can only be called if the cart is empty... otherwise it wil throw an exception
      • getTransactionId

        public java.lang.String getTransactionId()
      • setTransactionId

        public void setTransactionId​(java.lang.String transactionId)
      • getTerminalId

        public java.lang.String getTerminalId()
      • setTerminalId

        public void setTerminalId​(java.lang.String terminalId)
      • getAutoOrderShoppingListId

        public java.lang.String getAutoOrderShoppingListId()
      • setAutoOrderShoppingListId

        public void setAutoOrderShoppingListId​(java.lang.String autoOrderShoppingListId)
      • getFacilityId

        public java.lang.String getFacilityId()
      • setFacilityId

        public void setFacilityId​(java.lang.String facilityId)
      • getLocale

        public java.util.Locale getLocale()
      • setLocale

        public void setLocale​(java.util.Locale locale)
      • setOrderName

        public void setOrderName​(java.lang.String orderName)
      • getOrderName

        public java.lang.String getOrderName()
      • setWorkEffortId

        public void setWorkEffortId​(java.lang.String workEffortId)
      • getWorkEffortId

        public java.lang.String getWorkEffortId()
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
      • getAttribute

        public <T> T getAttribute​(java.lang.String name)
      • removeOrderAttribute

        public void removeOrderAttribute​(java.lang.String name)
      • setOrderAttribute

        public void setOrderAttribute​(java.lang.String name,
                                      java.lang.String value)
      • getOrderAttribute

        public java.lang.String getOrderAttribute​(java.lang.String name)
      • setHoldOrder

        public void setHoldOrder​(boolean b)
      • getHoldOrder

        public boolean getHoldOrder()
      • setOrderDate

        public void setOrderDate​(java.sql.Timestamp t)
      • getOrderDate

        public java.sql.Timestamp getOrderDate()
      • getCurrency

        public java.lang.String getCurrency()
        Get the current currency setting.
      • getCartCreatedTime

        public java.sql.Timestamp getCartCreatedTime()
      • getSupplierProduct

        public GenericValue getSupplierProduct​(java.lang.String productId,
                                               java.math.BigDecimal quantity,
                                               LocalDispatcher dispatcher)
      • addOrIncreaseItem

        public int addOrIncreaseItem​(java.lang.String productId,
                                     java.math.BigDecimal selectedAmount,
                                     java.math.BigDecimal quantity,
                                     java.sql.Timestamp reservStart,
                                     java.math.BigDecimal reservLength,
                                     java.math.BigDecimal reservPersons,
                                     java.sql.Timestamp shipBeforeDate,
                                     java.sql.Timestamp shipAfterDate,
                                     java.util.Map<java.lang.String,​GenericValue> features,
                                     java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                     java.lang.String prodCatalogId,
                                     ProductConfigWrapper configWrapper,
                                     java.lang.String itemType,
                                     java.lang.String itemGroupNumber,
                                     java.lang.String parentProductId,
                                     LocalDispatcher dispatcher)
                              throws CartItemModifyException,
                                     ItemNotFoundException
        Add an item to the shopping cart, or if already there, increase the quantity.
        Returns:
        the new/increased item index
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addOrIncreaseItem

        public int addOrIncreaseItem​(java.lang.String productId,
                                     java.math.BigDecimal selectedAmount,
                                     java.math.BigDecimal quantity,
                                     java.sql.Timestamp reservStart,
                                     java.math.BigDecimal reservLength,
                                     java.math.BigDecimal reservPersons,
                                     java.lang.String accommodationMapId,
                                     java.lang.String accommodationSpotId,
                                     java.sql.Timestamp shipBeforeDate,
                                     java.sql.Timestamp shipAfterDate,
                                     java.util.Map<java.lang.String,​GenericValue> features,
                                     java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                     java.lang.String prodCatalogId,
                                     ProductConfigWrapper configWrapper,
                                     java.lang.String itemType,
                                     java.lang.String itemGroupNumber,
                                     java.lang.String parentProductId,
                                     LocalDispatcher dispatcher)
                              throws CartItemModifyException,
                                     ItemNotFoundException
        add rental (with accommodation) item to cart
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addOrIncreaseItem

        public int addOrIncreaseItem​(java.lang.String productId,
                                     java.math.BigDecimal selectedAmount,
                                     java.math.BigDecimal quantity,
                                     java.sql.Timestamp reservStart,
                                     java.math.BigDecimal reservLength,
                                     java.math.BigDecimal reservPersons,
                                     java.lang.String accommodationMapId,
                                     java.lang.String accommodationSpotId,
                                     java.sql.Timestamp shipBeforeDate,
                                     java.sql.Timestamp shipAfterDate,
                                     java.util.Map<java.lang.String,​GenericValue> features,
                                     java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                     java.util.Map<java.lang.String,​java.lang.String> orderItemAttributes,
                                     java.lang.String prodCatalogId,
                                     ProductConfigWrapper configWrapper,
                                     java.lang.String itemType,
                                     java.lang.String itemGroupNumber,
                                     java.lang.String parentProductId,
                                     LocalDispatcher dispatcher)
                              throws CartItemModifyException,
                                     ItemNotFoundException
        add rental (with accommodation) item to cart and order item attributes
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addOrIncreaseItem

        public int addOrIncreaseItem​(java.lang.String productId,
                                     java.math.BigDecimal selectedAmount,
                                     java.math.BigDecimal quantity,
                                     java.sql.Timestamp reservStart,
                                     java.math.BigDecimal reservLength,
                                     java.math.BigDecimal reservPersons,
                                     java.lang.String accommodationMapId,
                                     java.lang.String accommodationSpotId,
                                     java.sql.Timestamp shipBeforeDate,
                                     java.sql.Timestamp shipAfterDate,
                                     java.sql.Timestamp reserveAfterDate,
                                     java.util.Map<java.lang.String,​GenericValue> features,
                                     java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                     java.util.Map<java.lang.String,​java.lang.String> orderItemAttributes,
                                     java.lang.String prodCatalogId,
                                     ProductConfigWrapper configWrapper,
                                     java.lang.String itemType,
                                     java.lang.String itemGroupNumber,
                                     java.lang.String parentProductId,
                                     LocalDispatcher dispatcher)
                              throws CartItemModifyException,
                                     ItemNotFoundException
        add rental (with accommodation) item to cart and order item attributes
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addNonProductItem

        public int addNonProductItem​(java.lang.String itemType,
                                     java.lang.String description,
                                     java.lang.String categoryId,
                                     java.math.BigDecimal price,
                                     java.math.BigDecimal quantity,
                                     java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                     java.lang.String prodCatalogId,
                                     java.lang.String itemGroupNumber,
                                     LocalDispatcher dispatcher)
                              throws CartItemModifyException
        Add a non-product item to the shopping cart.
        Returns:
        the new item index
        Throws:
        CartItemModifyException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.sql.Timestamp reservStart,
                                java.math.BigDecimal reservLength,
                                java.math.BigDecimal reservPersons,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an (rental)item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.sql.Timestamp reservStart,
                                java.math.BigDecimal reservLength,
                                java.math.BigDecimal reservPersons,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules,
                                java.lang.Boolean skipInventoryChecks,
                                java.lang.Boolean skipProductChecks)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an (rental)item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.sql.Timestamp reservStart,
                                java.math.BigDecimal reservLength,
                                java.math.BigDecimal reservPersons,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                ProductConfigWrapper configWrapper,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules,
                                java.lang.Boolean skipInventoryChecks,
                                java.lang.Boolean skipProductChecks)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an (rental/aggregated)item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.sql.Timestamp reservStart,
                                java.math.BigDecimal reservLength,
                                java.math.BigDecimal reservPersons,
                                java.lang.String accommodationMapId,
                                java.lang.String accommodationSpotId,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an accommodation(rental)item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.sql.Timestamp reservStart,
                                java.math.BigDecimal reservLength,
                                java.math.BigDecimal reservPersons,
                                java.lang.String accommodationMapId,
                                java.lang.String accommodationSpotId,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules,
                                java.lang.Boolean skipInventoryChecks,
                                java.lang.Boolean skipProductChecks)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an accommodation(rental)item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.sql.Timestamp reservStart,
                                java.math.BigDecimal reservLength,
                                java.math.BigDecimal reservPersonsDbl,
                                java.lang.String accommodationMapId,
                                java.lang.String accommodationSpotId,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                ProductConfigWrapper configWrapper,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules,
                                java.lang.Boolean skipInventoryChecks,
                                java.lang.Boolean skipProductChecks)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an accommodation(rental/aggregated)item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • addItemToEnd

        public int addItemToEnd​(java.lang.String productId,
                                java.math.BigDecimal amount,
                                java.math.BigDecimal quantity,
                                java.math.BigDecimal unitPrice,
                                java.util.HashMap<java.lang.String,​GenericValue> features,
                                java.util.HashMap<java.lang.String,​java.lang.Object> attributes,
                                java.lang.String prodCatalogId,
                                java.lang.String itemType,
                                LocalDispatcher dispatcher,
                                java.lang.Boolean triggerExternalOps,
                                java.lang.Boolean triggerPriceRules,
                                java.lang.Boolean skipInventoryChecks,
                                java.lang.Boolean skipProductChecks)
                         throws CartItemModifyException,
                                ItemNotFoundException
        Add an item to the shopping cart.
        Throws:
        CartItemModifyException
        ItemNotFoundException
      • findCartItem

        public ShoppingCartItem findCartItem​(java.lang.String productId,
                                             java.util.Map<java.lang.String,​GenericValue> features,
                                             java.util.Map<java.lang.String,​java.lang.Object> attributes,
                                             java.lang.String prodCatalogId,
                                             java.math.BigDecimal selectedAmount)
        Get a ShoppingCartItem from the cart object.
      • findAllCartItems

        public java.util.List<ShoppingCartItem> findAllCartItems​(java.lang.String productId)
        Get all ShoppingCartItems from the cart object with the given productId.
      • findAllCartItems

        public java.util.List<ShoppingCartItem> findAllCartItems​(java.lang.String productId,
                                                                 java.lang.String groupNumber)
        Get all ShoppingCartItems from the cart object with the given productId and optional groupNumber to limit it to a specific item group
      • findAllCartItemsInCategory

        public java.util.List<ShoppingCartItem> findAllCartItemsInCategory​(java.lang.String productCategoryId,
                                                                           java.lang.String groupNumber)
        Get all ShoppingCartItems from the cart object with the given productCategoryId and optional groupNumber to limit it to a specific item group
      • removeEmptyCartItems

        public void removeEmptyCartItems()
        Remove quantity 0 ShoppingCartItems from the cart object.
      • getItemsTotalQuantity

        public static java.math.BigDecimal getItemsTotalQuantity​(java.util.List<ShoppingCartItem> cartItems)
      • containAnyWorkEffortCartItems

        public boolean containAnyWorkEffortCartItems()
      • containAllWorkEffortCartItems

        public boolean containAllWorkEffortCartItems()
      • containOnlyDigitalGoods

        public boolean containOnlyDigitalGoods()
        Check to see if the cart contains only Digital Goods, ie no Finished Goods and no Finished/Digital Goods, et cetera. This is determined by making sure no Product has a type where ProductType.isPhysical!=N.
      • containOnlyDigitalGoods

        public boolean containOnlyDigitalGoods​(int shipGroupIdx)
        Check to see if the ship group contains only Digital Goods, ie no Finished Goods and no Finished/Digital Goods, et cetera. This is determined by making sure no Product has a type where ProductType.isPhysical!=N.
      • getItemIndex

        public int getItemIndex​(ShoppingCartItem item)
        Returns this item's index.
      • findCartItem

        public ShoppingCartItem findCartItem​(int index)
        Get a ShoppingCartItem from the cart object.
      • findCartItem

        public ShoppingCartItem findCartItem​(java.lang.String orderItemSeqId)
      • moveCartItem

        public void moveCartItem​(int fromIndex,
                                 int toIndex)
        Moves a line item to a different index.
      • size

        public int size()
        Returns the number of items in the cart object.
      • items

        public java.util.List<ShoppingCartItem> items()
        Returns a Collection of items in the cart object.
      • iterator

        public java.util.Iterator<ShoppingCartItem> iterator()
        Returns an iterator of cart items.
        Specified by:
        iterator in interface java.lang.Iterable<ShoppingCartItem>
      • addItemGroup

        public java.lang.String addItemGroup​(java.lang.String groupName,
                                             java.lang.String parentGroupNumber)
        Creates a new Item Group and returns the groupNumber that represents it
      • getCartItemsInNoGroup

        public java.util.List<ShoppingCartItem> getCartItemsInNoGroup()
      • getCartItemsInGroup

        public java.util.List<ShoppingCartItem> getCartItemsInGroup​(java.lang.String groupNumber)
      • deleteItemGroup

        public void deleteItemGroup​(java.lang.String groupNumber)
      • getUserLogin

        public GenericValue getUserLogin()
        Gets the userLogin associated with the cart; may be null
      • setUserLogin

        protected void setUserLogin​(GenericValue userLogin)
      • setAutoUserLogin

        protected void setAutoUserLogin​(GenericValue autoUserLogin)
      • getExternalId

        public java.lang.String getExternalId()
      • setExternalId

        public void setExternalId​(java.lang.String externalId)
      • getInternalCode

        public java.lang.String getInternalCode()
      • setInternalCode

        public void setInternalCode​(java.lang.String internalCode)
      • getWebSiteId

        public java.lang.String getWebSiteId()
      • setWebSiteId

        public void setWebSiteId​(java.lang.String webSiteId)
      • setShipBeforeDate

        public void setShipBeforeDate​(int idx,
                                      java.sql.Timestamp shipBeforeDate)
        Set ship before date for a particular ship group
        Parameters:
        idx -
        shipBeforeDate -
      • setShipBeforeDate

        public void setShipBeforeDate​(java.sql.Timestamp shipBeforeDate)
        Set ship before date for ship group 0
        Parameters:
        shipBeforeDate -
      • getShipBeforeDate

        public java.sql.Timestamp getShipBeforeDate​(int idx)
        Get ship before date for a particular ship group
        Parameters:
        idx - the ship group number
        Returns:
        ship before date for a given ship group
      • getShipBeforeDate

        public java.sql.Timestamp getShipBeforeDate()
        Get ship before date for ship group 0
        Returns:
        ship before date for the first ship group
      • setShipAfterDate

        public void setShipAfterDate​(int idx,
                                     java.sql.Timestamp shipAfterDate)
        Set ship after date for a particular ship group
        Parameters:
        idx - the ship group number
        shipAfterDate - the ship after date to be set for the given ship group
      • setShipAfterDate

        public void setShipAfterDate​(java.sql.Timestamp shipAfterDate)
        Set ship after date for a particular ship group
        Parameters:
        shipAfterDate - the ship after date to be set for the first ship group
      • getShipAfterDate

        public java.sql.Timestamp getShipAfterDate​(int idx)
        Get ship after date for a particular ship group
        Parameters:
        idx - the ship group number
        Returns:
        return the ship after date for the given ship group
      • getShipAfterDate

        public java.sql.Timestamp getShipAfterDate()
        Get ship after date for ship group 0
        Returns:
        return the ship after date for the first ship group
      • setDefaultShipBeforeDate

        public void setDefaultShipBeforeDate​(java.sql.Timestamp defaultShipBeforeDate)
      • getDefaultShipBeforeDate

        public java.sql.Timestamp getDefaultShipBeforeDate()
      • setDefaultShipAfterDate

        public void setDefaultShipAfterDate​(java.sql.Timestamp defaultShipAfterDate)
      • setCancelBackOrderDate

        public void setCancelBackOrderDate​(java.sql.Timestamp cancelBackOrderDate)
      • getCancelBackOrderDate

        public java.sql.Timestamp getCancelBackOrderDate()
      • getDefaultShipAfterDate

        public java.sql.Timestamp getDefaultShipAfterDate()
      • setDefaultReserveAfterDate

        public void setDefaultReserveAfterDate​(java.sql.Timestamp defaultReserveAfterDate)
      • getDefaultReserveAfterDate

        public java.sql.Timestamp getDefaultReserveAfterDate()
      • getOrderPartyId

        public java.lang.String getOrderPartyId()
      • setOrderPartyId

        public void setOrderPartyId​(java.lang.String orderPartyId)
      • getPlacingCustomerPartyId

        public java.lang.String getPlacingCustomerPartyId()
      • setPlacingCustomerPartyId

        public void setPlacingCustomerPartyId​(java.lang.String placingCustomerPartyId)
      • getBillToCustomerPartyId

        public java.lang.String getBillToCustomerPartyId()
      • setBillToCustomerPartyId

        public void setBillToCustomerPartyId​(java.lang.String billToCustomerPartyId)
      • getShipToCustomerPartyId

        public java.lang.String getShipToCustomerPartyId()
      • setShipToCustomerPartyId

        public void setShipToCustomerPartyId​(java.lang.String shipToCustomerPartyId)
      • getEndUserCustomerPartyId

        public java.lang.String getEndUserCustomerPartyId()
      • setEndUserCustomerPartyId

        public void setEndUserCustomerPartyId​(java.lang.String endUserCustomerPartyId)
      • getBillFromVendorPartyId

        public java.lang.String getBillFromVendorPartyId()
      • setBillFromVendorPartyId

        public void setBillFromVendorPartyId​(java.lang.String billFromVendorPartyId)
      • getShipFromVendorPartyId

        public java.lang.String getShipFromVendorPartyId()
      • setShipFromVendorPartyId

        public void setShipFromVendorPartyId​(java.lang.String shipFromVendorPartyId)
      • getSupplierAgentPartyId

        public java.lang.String getSupplierAgentPartyId()
      • setSupplierAgentPartyId

        public void setSupplierAgentPartyId​(java.lang.String supplierAgentPartyId)
      • getPartyId

        public java.lang.String getPartyId()
      • setAutoSaveListId

        public void setAutoSaveListId​(java.lang.String id)
      • getAutoSaveListId

        public java.lang.String getAutoSaveListId()
      • setLastListRestore

        public void setLastListRestore​(java.sql.Timestamp time)
      • getLastListRestore

        public java.sql.Timestamp getLastListRestore()
      • getPartyDaysSinceCreated

        public java.math.BigDecimal getPartyDaysSinceCreated​(java.sql.Timestamp nowTimestamp)
      • clear

        public void clear()
        Clears out the cart.
      • setOrderType

        public void setOrderType​(java.lang.String orderType)
        Sets the order type.
      • getOrderType

        public java.lang.String getOrderType()
        Returns the order type.
      • setChannelType

        public void setChannelType​(java.lang.String channelType)
      • getChannelType

        public java.lang.String getChannelType()
      • isPurchaseOrder

        public boolean isPurchaseOrder()
      • isSalesOrder

        public boolean isSalesOrder()
      • setPoNumber

        public void setPoNumber​(java.lang.String poNumber)
        Sets the PO Number in the cart.
      • getPoNumber

        public java.lang.String getPoNumber()
        Returns the po number.
      • setDefaultItemDeliveryDate

        public void setDefaultItemDeliveryDate​(java.lang.String date)
      • getDefaultItemDeliveryDate

        public java.lang.String getDefaultItemDeliveryDate()
      • setDefaultItemComment

        public void setDefaultItemComment​(java.lang.String comment)
      • getDefaultItemComment

        public java.lang.String getDefaultItemComment()
      • setAgreementId

        public void setAgreementId​(java.lang.String agreementId)
      • getAgreementId

        public java.lang.String getAgreementId()
      • setQuoteId

        public void setQuoteId​(java.lang.String quoteId)
      • getQuoteId

        public java.lang.String getQuoteId()
      • getPaymentMethodTypeId

        public java.lang.String getPaymentMethodTypeId​(java.lang.String paymentMethodId)
      • makePaymentInfo

        public ShoppingCart.CartPaymentInfo makePaymentInfo​(java.lang.String id,
                                                            java.lang.String refNum,
                                                            java.math.BigDecimal amount)
        Creates a CartPaymentInfo object
      • makePaymentInfo

        public ShoppingCart.CartPaymentInfo makePaymentInfo​(java.lang.String id,
                                                            java.lang.String refNum,
                                                            java.lang.String authCode,
                                                            java.math.BigDecimal amount)
        Creates a CartPaymentInfo object with a possible authCode (may be null)
      • getPaymentInfoIndex

        public int getPaymentInfoIndex​(java.lang.String id,
                                       java.lang.String refNum)
        Locates the index of an existing CartPaymentInfo object or -1 if none found
      • getPaymentInfos

        public java.util.List<ShoppingCart.CartPaymentInfo> getPaymentInfos​(boolean isPaymentMethod,
                                                                            boolean isPaymentMethodType,
                                                                            boolean hasRefNum)
        Returns the CartPaymentInfo objects which have matching fields
      • getPaymentInfo

        public ShoppingCart.CartPaymentInfo getPaymentInfo​(java.lang.String id,
                                                           java.lang.String refNum,
                                                           java.lang.String authCode,
                                                           java.math.BigDecimal amount,
                                                           boolean update)
        Locates an existing (or creates a new) CartPaymentInfo object
      • getPaymentInfo

        public ShoppingCart.CartPaymentInfo getPaymentInfo​(java.lang.String id,
                                                           java.lang.String refNum,
                                                           java.lang.String authCode,
                                                           java.math.BigDecimal amount)
        Locates an existing (or creates a new) CartPaymentInfo object
      • getPaymentInfo

        public ShoppingCart.CartPaymentInfo getPaymentInfo​(java.lang.String id)
        Locates an existing (or creates a new) CartPaymentInfo object
      • addPaymentAmount

        public ShoppingCart.CartPaymentInfo addPaymentAmount​(java.lang.String id,
                                                             java.math.BigDecimal amount,
                                                             java.lang.String refNum,
                                                             java.lang.String authCode,
                                                             boolean isSingleUse,
                                                             boolean isPresent,
                                                             boolean replace)
        adds a payment method/payment method type
      • addPaymentAmount

        public ShoppingCart.CartPaymentInfo addPaymentAmount​(java.lang.String id,
                                                             java.math.BigDecimal amount,
                                                             boolean isSingleUse)
        adds a payment method/payment method type
      • addPaymentAmount

        public ShoppingCart.CartPaymentInfo addPaymentAmount​(java.lang.String id,
                                                             java.math.BigDecimal amount)
        adds a payment method/payment method type
      • getPaymentAmount

        public java.math.BigDecimal getPaymentAmount​(java.lang.String id)
        returns the payment method/payment method type amount
      • addPaymentRef

        public void addPaymentRef​(java.lang.String id,
                                  java.lang.String ref,
                                  java.lang.String authCode)
      • getPaymentRef

        public java.lang.String getPaymentRef​(java.lang.String id)
      • getPaymentTotal

        public java.math.BigDecimal getPaymentTotal()
        returns the total payment amounts
      • selectedPayments

        public int selectedPayments()
      • isPaymentSelected

        public boolean isPaymentSelected​(java.lang.String id)
      • clearPayment

        public void clearPayment​(java.lang.String id)
        removes a specific payment method/payment method type
      • clearPayment

        public void clearPayment​(int index)
        removes a specific payment info from the list
      • clearPayments

        public void clearPayments()
        clears all payment method/payment method types
      • clearPaymentMethodsById

        public void clearPaymentMethodsById​(java.util.List<java.lang.String> paymentMethodIdsToRemove)
        remove all the paymentMethods based on the paymentMethodIds
      • clearDeclinedPaymentMethods

        public void clearDeclinedPaymentMethods​(Delegator delegator)
        remove declined payment methods for an order from cart. The idea is to call this after an attempted order is rejected
      • getPaymentMethodIds

        public java.util.List<java.lang.String> getPaymentMethodIds()
        Returns the Payment Method Ids
      • getPaymentMethodTypeIds

        public java.util.List<java.lang.String> getPaymentMethodTypeIds()
        Returns the Payment Method Type Ids
      • getPaymentMethods

        public java.util.List<GenericValue> getPaymentMethods()
        Returns a list of PaymentMethod value objects selected in the cart
      • getPaymentMethodTypes

        public java.util.List<GenericValue> getPaymentMethodTypes()
        Returns a list of PaymentMethodType value objects selected in the cart
      • getCreditCards

        public java.util.List<GenericValue> getCreditCards()
      • getGiftCards

        public java.util.List<GenericValue> getGiftCards()
      • isPaymentMethodType

        public boolean isPaymentMethodType​(java.lang.String id)
      • getBillingAddress

        public GenericValue getBillingAddress()
      • getGiftCertSettingFromStore

        public GenericValue getGiftCertSettingFromStore​(Delegator delegator)
                                                 throws GenericEntityException
        Returns ProductStoreFinActSetting based on cart's productStoreId and FinAccountHelper's defined giftCertFinAcctTypeId
        Parameters:
        delegator - the delegator
        Returns:
        returns ProductStoreFinActSetting based on cart's productStoreId
        Throws:
        GenericEntityException
      • isPinRequiredForGC

        public boolean isPinRequiredForGC​(Delegator delegator)
        Determines whether pin numbers are required for gift cards, based on ProductStoreFinActSetting. Default to true.
        Parameters:
        delegator - the delegator
        Returns:
        returns true whether pin numbers are required for gift card
      • isValidateGCFinAccount

        public boolean isValidateGCFinAccount​(Delegator delegator)
        Returns whether the cart should validate gift cards against FinAccount (ie, internal gift certificates). Defaults to false.
        Parameters:
        delegator - the delegator
        Returns:
        returns true whether the cart should validate gift cards against FinAccount
      • setBillingAccount

        public void setBillingAccount​(java.lang.String billingAccountId,
                                      java.math.BigDecimal amount)
        Sets the billing account id string.
      • getBillingAccountId

        public java.lang.String getBillingAccountId()
        Returns the billing message string.
      • getBillingAccountAmount

        public java.math.BigDecimal getBillingAccountAmount()
        Returns the amount to be billed to the billing account.
      • getOrderShipping

        public java.math.BigDecimal getOrderShipping()
        Returns the order level shipping amount
      • addShipInfo

        public int addShipInfo()
      • getShipGroups

        public java.util.Map<java.lang.Integer,​java.math.BigDecimal> getShipGroups​(ShoppingCartItem item)
      • getShipGroups

        public java.util.Map<java.lang.Integer,​java.math.BigDecimal> getShipGroups​(int itemIndex)
      • getShipGroupSize

        public int getShipGroupSize()
      • getShipGroupItems

        public java.util.Map<ShoppingCartItem,​java.math.BigDecimal> getShipGroupItems​(int idx)
        Returns the ShoppingCartItem (key) and quantity (value) associated with the ship group
      • setItemShipGroupEstimate

        public void setItemShipGroupEstimate​(java.math.BigDecimal amount,
                                             int idx)
      • setShipGroupShipDatesFromItem

        public void setShipGroupShipDatesFromItem​(ShoppingCartItem item)
        Updates the shipBefore and shipAfterDates of all ship groups that the item belongs to, re-setting ship group ship before date if item ship before date is before it and ship group ship after date if item ship after date is before it.
        Parameters:
        item -
      • getItemShipGroupEstimate

        public java.math.BigDecimal getItemShipGroupEstimate​(int idx)
      • setItemShipGroupQty

        public void setItemShipGroupQty​(int itemIndex,
                                        java.math.BigDecimal quantity,
                                        int idx)
      • setItemShipGroupQty

        public void setItemShipGroupQty​(ShoppingCartItem item,
                                        java.math.BigDecimal quantity,
                                        int idx)
      • setItemShipGroupQty

        public void setItemShipGroupQty​(ShoppingCartItem item,
                                        int itemIndex,
                                        java.math.BigDecimal quantity,
                                        int idx)
      • getItemShipGroupQty

        public java.math.BigDecimal getItemShipGroupQty​(ShoppingCartItem item,
                                                        int idx)
      • getItemShipGroupQty

        public java.math.BigDecimal getItemShipGroupQty​(int itemIndex,
                                                        int idx)
      • positionItemToGroup

        public void positionItemToGroup​(int itemIndex,
                                        java.math.BigDecimal quantity,
                                        int fromIndex,
                                        int toIndex,
                                        boolean clearEmptyGroups)
      • positionItemToGroup

        public void positionItemToGroup​(ShoppingCartItem item,
                                        java.math.BigDecimal quantity,
                                        int fromIndex,
                                        int toIndex,
                                        boolean clearEmptyGroups)
      • cleanUpShipGroups

        public void cleanUpShipGroups()
      • getShipInfoIndex

        public int getShipInfoIndex​(java.lang.String shipGroupSeqId)
      • getItemShipGroupIndex

        public int getItemShipGroupIndex​(int itemId)
        Return index of the ship group where the item is located
        Returns:
      • setShippingContactMechId

        public void setShippingContactMechId​(int idx,
                                             java.lang.String shippingContactMechId)
        Sets the shipping contact mech id.
      • setAllShippingContactMechId

        public void setAllShippingContactMechId​(java.lang.String shippingContactMechId)
        Sets @param shippingContactMechId in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        shippingContactMechId -
      • getShippingContactMechId

        public java.lang.String getShippingContactMechId​(int idx)
        Returns the shipping contact mech id.
      • getShippingContactMechId

        public java.lang.String getShippingContactMechId()
      • setShipmentMethodTypeId

        public void setShipmentMethodTypeId​(int idx,
                                            java.lang.String shipmentMethodTypeId)
        Sets the shipment method type.
      • setAllShipmentMethodTypeId

        public void setAllShipmentMethodTypeId​(java.lang.String shipmentMethodTypeId)
        Sets @param shipmentMethodTypeId in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        shipmentMethodTypeId -
      • getShipmentMethodTypeId

        public java.lang.String getShipmentMethodTypeId​(int idx)
        Returns the shipment method type ID
      • getShipmentMethodTypeId

        public java.lang.String getShipmentMethodTypeId()
      • getShipmentMethodType

        public GenericValue getShipmentMethodType​(int idx)
        Returns the shipment method type.
      • setSupplierPartyId

        public void setSupplierPartyId​(int idx,
                                       java.lang.String supplierPartyId)
        Sets the supplier for the given ship group (drop shipment).
      • getSupplierPartyId

        public java.lang.String getSupplierPartyId​(int idx)
        Returns the supplier for the given ship group (drop shipment).
      • setSupplierAgreementId

        public void setSupplierAgreementId​(int idx,
                                           java.lang.String supplierAgreementId)
        Sets the supplier agreement for the given ship group (drop shipment).
      • getSupplierAgreementId

        public java.lang.String getSupplierAgreementId​(int idx)
        Returns the supplier Agreement for the given ship group (drop shipment).
      • setShippingInstructions

        public void setShippingInstructions​(int idx,
                                            java.lang.String shippingInstructions)
        Sets the shipping instructions.
      • setAllShippingInstructions

        public void setAllShippingInstructions​(java.lang.String shippingInstructions)
        Sets @param shippingInstructions in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        shippingInstructions -
      • getShippingInstructions

        public java.lang.String getShippingInstructions​(int idx)
        Returns the shipping instructions.
      • getShippingInstructions

        public java.lang.String getShippingInstructions()
      • setMaySplit

        public void setMaySplit​(int idx,
                                java.lang.Boolean maySplit)
      • setAllMaySplit

        public void setAllMaySplit​(java.lang.Boolean maySplit)
        Sets @param maySplit in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        maySplit -
      • getMaySplit

        public java.lang.String getMaySplit​(int idx)
        Returns Boolean.TRUE if the order may be split (null if unspecified)
      • getMaySplit

        public java.lang.String getMaySplit()
      • setGiftMessage

        public void setGiftMessage​(int idx,
                                   java.lang.String giftMessage)
      • setAllGiftMessage

        public void setAllGiftMessage​(java.lang.String giftMessage)
        Sets @param giftMessage in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        giftMessage -
      • getGiftMessage

        public java.lang.String getGiftMessage​(int idx)
      • getGiftMessage

        public java.lang.String getGiftMessage()
      • setIsGift

        public void setIsGift​(int idx,
                              java.lang.Boolean isGift)
      • setAllIsGift

        public void setAllIsGift​(java.lang.Boolean isGift)
        Sets @param isGift in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        isGift -
      • getIsGift

        public java.lang.String getIsGift​(int idx)
      • getIsGift

        public java.lang.String getIsGift()
      • setCarrierPartyId

        public void setCarrierPartyId​(int idx,
                                      java.lang.String carrierPartyId)
      • setAllCarrierPartyId

        public void setAllCarrierPartyId​(java.lang.String carrierPartyId)
        Sets @param carrierPartyId in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        carrierPartyId -
      • getCarrierPartyId

        public java.lang.String getCarrierPartyId​(int idx)
      • getCarrierPartyId

        public java.lang.String getCarrierPartyId()
      • getProductStoreShipMethId

        public java.lang.String getProductStoreShipMethId​(int idx)
      • getProductStoreShipMethId

        public java.lang.String getProductStoreShipMethId()
      • setProductStoreShipMethId

        public void setProductStoreShipMethId​(int idx,
                                              java.lang.String productStoreShipMethId)
      • setAllProductStoreShipMethId

        public void setAllProductStoreShipMethId​(java.lang.String productStoreShipMethId)
        Sets @param productStoreShipMethId in all ShipInfo(ShipGroups) associated with this ShoppingCart

        Parameters:
        productStoreShipMethId -
      • setShipGroupFacilityId

        public void setShipGroupFacilityId​(int idx,
                                           java.lang.String facilityId)
      • getShipGroupFacilityId

        public java.lang.String getShipGroupFacilityId​(int idx)
      • setShipGroupVendorPartyId

        public void setShipGroupVendorPartyId​(int idx,
                                              java.lang.String vendorPartyId)
      • getShipGroupVendorPartyId

        public java.lang.String getShipGroupVendorPartyId​(int idx)
      • setShipGroupSeqId

        public void setShipGroupSeqId​(int idx,
                                      java.lang.String shipGroupSeqId)
      • getShipGroupSeqId

        public java.lang.String getShipGroupSeqId​(int idx)
      • setOrderAdditionalEmails

        public void setOrderAdditionalEmails​(java.lang.String orderAdditionalEmails)
      • getOrderAdditionalEmails

        public java.lang.String getOrderAdditionalEmails()
      • getShippingAddress

        public GenericValue getShippingAddress​(int idx)
      • getOriginAddress

        public GenericValue getOriginAddress​(int idx)
      • getShippingAddress

        public GenericValue getShippingAddress()
      • getInternalOrderNotes

        public java.util.List<java.lang.String> getInternalOrderNotes()
      • getOrderNotes

        public java.util.List<java.lang.String> getOrderNotes()
      • addInternalOrderNote

        public void addInternalOrderNote​(java.lang.String note)
      • clearInternalOrderNotes

        public void clearInternalOrderNotes()
      • clearOrderNotes

        public void clearOrderNotes()
      • addOrderNote

        public void addOrderNote​(java.lang.String note)
      • setDefaultCheckoutOptions

        public void setDefaultCheckoutOptions​(LocalDispatcher dispatcher)
      • getTotalSalesTax

        public java.math.BigDecimal getTotalSalesTax​(int shipGroup)
      • getTotalSalesTax

        public java.math.BigDecimal getTotalSalesTax()
        Returns the tax amount from the cart object.
      • getTotalShipping

        public java.math.BigDecimal getTotalShipping()
        Returns the shipping amount from the cart object.
      • getItemTotal

        public java.math.BigDecimal getItemTotal()
        Returns the item-total in the cart (not including discount/tax/shipping).
      • getSubTotal

        public java.math.BigDecimal getSubTotal()
        Returns the sub-total in the cart (item-total - discount).
      • getGrandTotal

        public java.math.BigDecimal getGrandTotal()
        Returns the total from the cart, including tax/shipping.
      • getDisplaySubTotal

        public java.math.BigDecimal getDisplaySubTotal()
      • getOrderGlobalAdjustments

        public java.math.BigDecimal getOrderGlobalAdjustments()
      • getDisplayTaxIncluded

        public java.math.BigDecimal getDisplayTaxIncluded()
      • getDisplayRecurringSubTotal

        public java.math.BigDecimal getDisplayRecurringSubTotal()
      • getDisplayGrandTotal

        public java.math.BigDecimal getDisplayGrandTotal()
        Returns the total from the cart, including tax/shipping.
      • getOrderOtherAdjustmentTotal

        public java.math.BigDecimal getOrderOtherAdjustmentTotal()
      • getSubTotalForPromotions

        public java.math.BigDecimal getSubTotalForPromotions()
        Returns the sub-total in the cart (item-total - discount).
      • getSubTotalForPromotions

        public java.math.BigDecimal getSubTotalForPromotions​(java.util.Set<java.lang.String> productIds)
      • getOrderPaymentPreferenceTotalByType

        public java.math.BigDecimal getOrderPaymentPreferenceTotalByType​(java.lang.String paymentMethodTypeId)
        Get the total payment amount by payment type. Specify null to get amount over all types.
      • getCreditCardPaymentPreferenceTotal

        public java.math.BigDecimal getCreditCardPaymentPreferenceTotal()
      • getBillingAccountPaymentPreferenceTotal

        public java.math.BigDecimal getBillingAccountPaymentPreferenceTotal()
      • getGiftCardPaymentPreferenceTotal

        public java.math.BigDecimal getGiftCardPaymentPreferenceTotal()
      • addContactMech

        public void addContactMech​(java.lang.String contactMechPurposeTypeId,
                                   java.lang.String contactMechId)
        Add a contact mech to this purpose; the contactMechPurposeTypeId is required
      • getContactMech

        public java.lang.String getContactMech​(java.lang.String contactMechPurposeTypeId)
        Get the contactMechId for this cart given the contactMechPurposeTypeId
      • removeContactMech

        public java.lang.String removeContactMech​(java.lang.String contactMechPurposeTypeId)
        Remove the contactMechId from this cart given the contactMechPurposeTypeId
      • getOrderContactMechIds

        public java.util.Map<java.lang.String,​java.lang.String> getOrderContactMechIds()
      • getAdjustments

        public java.util.List<GenericValue> getAdjustments()
        Get a List of adjustments on the order (ie cart)
      • getAdjustmentPromoIndex

        public int getAdjustmentPromoIndex​(java.lang.String productPromoId)
      • addAdjustment

        public int addAdjustment​(GenericValue adjustment)
        Add an adjustment to the order; don't worry about setting the orderId, orderItemSeqId or orderAdjustmentId; they will be set when the order is created
      • removeAdjustment

        public void removeAdjustment​(int index)
      • getAdjustment

        public GenericValue getAdjustment​(int index)
      • getOrderTerms

        public java.util.List<GenericValue> getOrderTerms()
        Get a List of orderTerms on the order (ie cart)
      • addOrderTerm

        public int addOrderTerm​(java.lang.String termTypeId,
                                java.math.BigDecimal termValue,
                                java.lang.Long termDays)
        Add an orderTerm to the order
      • addOrderTerm

        public int addOrderTerm​(java.lang.String termTypeId,
                                java.math.BigDecimal termValue,
                                java.lang.Long termDays,
                                java.lang.String textValue)
        Add an orderTerm to the order
      • addOrderTerm

        public int addOrderTerm​(java.lang.String termTypeId,
                                java.lang.String orderItemSeqId,
                                java.math.BigDecimal termValue,
                                java.lang.Long termDays,
                                java.lang.String textValue,
                                java.lang.String description)
      • addOrderTerm

        public int addOrderTerm​(GenericValue orderTerm)
        Add an orderTerm to the order
      • removeOrderTerm

        public void removeOrderTerm​(int index)
      • removeOrderTerms

        public void removeOrderTerms()
      • isOrderTermSet

        public boolean isOrderTermSet()
      • setOrderTermSet

        public void setOrderTermSet​(boolean orderTermSet)
      • hasOrderTerm

        public boolean hasOrderTerm​(java.lang.String termTypeId)
      • isReadOnlyCart

        public boolean isReadOnlyCart()
      • setReadOnlyCart

        public void setReadOnlyCart​(boolean readOnlyCart)
      • removeAdjustmentByType

        public void removeAdjustmentByType​(java.lang.String orderAdjustmentTypeId)
        go through the order adjustments and remove all adjustments with the given type
      • getTotalWeight

        public java.math.BigDecimal getTotalWeight()
        Returns the total weight in the cart.
      • getTotalQuantity

        public java.math.BigDecimal getTotalQuantity()
        Returns the total quantity in the cart.
      • getShippableTotal

        public java.math.BigDecimal getShippableTotal​(int idx)
        Returns the SHIPPABLE item-total in the cart for a specific ship group.
      • getShippableQuantity

        public java.math.BigDecimal getShippableQuantity​(int idx)
        Returns the total SHIPPABLE quantity in the cart for a specific ship group.
      • getShippableWeight

        public java.math.BigDecimal getShippableWeight​(int idx)
        Returns the total SHIPPABLE weight in the cart for a specific ship group.
      • getShippableSizes

        public java.util.List<java.math.BigDecimal> getShippableSizes​(int idx)
        Returns a List of shippable item's size for a specific ship group.
      • getShippableItemInfo

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getShippableItemInfo​(int idx)
        Returns a List of shippable item info (quantity, size, weight) for a specific ship group
      • shippingApplies

        public boolean shippingApplies()
        Returns true when there are shippable items in the cart
      • taxApplies

        public boolean taxApplies()
        Returns true when there are taxable items in the cart
      • getFeatureIdQtyMap

        public java.util.Map<java.lang.String,​java.math.BigDecimal> getFeatureIdQtyMap​(int idx)
        Returns a Map of all features applied to products in the cart with quantities for a specific ship group.
      • viewCartOnAdd

        public boolean viewCartOnAdd()
        Returns true if the user wishes to view the cart everytime an item is added.
      • setViewCartOnAdd

        public void setViewCartOnAdd​(boolean viewCartOnAdd)
        Returns true if the user wishes to view the cart everytime an item is added.
      • getOrderId

        public java.lang.String getOrderId()
        Returns the order ID associated with this cart or null if no order has been created yet.
      • getFirstAttemptOrderId

        public java.lang.String getFirstAttemptOrderId()
        Returns the first attempt order ID associated with this cart or null if no order has been created yet.
      • setOrderId

        public void setOrderId​(java.lang.String orderId)
        Sets the orderId associated with this cart.
      • setFirstAttemptOrderId

        public void setFirstAttemptOrderId​(java.lang.String orderId)
        TODO: Sets the first attempt orderId for this cart.
      • removeAllFreeShippingProductPromoActions

        public void removeAllFreeShippingProductPromoActions()
      • removeFreeShippingProductPromoAction

        public void removeFreeShippingProductPromoAction​(GenericPK productPromoActionPK)
        Removes a free shipping ProductPromoAction by trying to find one in the list with the same primary key.
      • addFreeShippingProductPromoAction

        public void addFreeShippingProductPromoAction​(GenericValue productPromoAction)
        Adds a ProductPromoAction to be used for free shipping (must be of type free shipping, or nothing will be done).
      • getFreeShippingProductPromoActions

        public java.util.List<GenericValue> getFreeShippingProductPromoActions()
      • removeAllDesiredAlternateGiftByActions

        public void removeAllDesiredAlternateGiftByActions()
      • setDesiredAlternateGiftByAction

        public void setDesiredAlternateGiftByAction​(GenericPK productPromoActionPK,
                                                    java.lang.String productId)
      • getDesiredAlternateGiftByAction

        public java.lang.String getDesiredAlternateGiftByAction​(GenericPK productPromoActionPK)
      • getAllDesiredAlternateGiftByActionCopy

        public java.util.Map<GenericPK,​java.lang.String> getAllDesiredAlternateGiftByActionCopy()
      • addProductPromoUse

        public void addProductPromoUse​(java.lang.String productPromoId,
                                       java.lang.String productPromoCodeId,
                                       java.math.BigDecimal totalDiscountAmount,
                                       java.math.BigDecimal quantityLeftInActions,
                                       java.util.Map<ShoppingCartItem,​java.math.BigDecimal> usageInfoMap)
      • removeProductPromoUse

        public void removeProductPromoUse​(java.lang.String productPromoId)
      • clearProductPromoUseInfo

        public void clearProductPromoUseInfo()
      • clearCartItemUseInPromoInfo

        public void clearCartItemUseInPromoInfo()
      • getProductPromoTotal

        public java.math.BigDecimal getProductPromoTotal()
      • getProductPromoUseTotalDiscount

        public java.math.BigDecimal getProductPromoUseTotalDiscount​(java.lang.String productPromoId)
        Get total discount for a given ProductPromo, or for ANY ProductPromo if the passed in productPromoId is null.
      • getProductPromoUseCount

        public int getProductPromoUseCount​(java.lang.String productPromoId)
      • getProductPromoCodeUse

        public int getProductPromoCodeUse​(java.lang.String productPromoCodeId)
      • clearAllPromotionInformation

        public void clearAllPromotionInformation()
      • clearAllPromotionAdjustments

        public void clearAllPromotionAdjustments()
      • clearAllAdjustments

        public void clearAllAdjustments()
      • clearAllItemStatus

        public void clearAllItemStatus()
      • addProductPromoCode

        public java.lang.String addProductPromoCode​(java.lang.String productPromoCodeId,
                                                    LocalDispatcher dispatcher)
        Adds a promotion code to the cart, checking if it is valid. If it is valid this will return null, otherwise it will return a message stating why it was not valid
        Parameters:
        productPromoCodeId - The promotion code to check and add
        Returns:
        String that is null if valid, and added to cart, or an error message of the code was not valid and not added to the cart.
      • getProductPromoCodesEntered

        public java.util.Set<java.lang.String> getProductPromoCodesEntered()
      • resetPromoRuleUse

        public void resetPromoRuleUse​(java.lang.String productPromoId,
                                      java.lang.String productPromoRuleId)
      • confirmPromoRuleUse

        public void confirmPromoRuleUse​(java.lang.String productPromoId,
                                        java.lang.String productPromoRuleId)
      • addAdditionalPartyRole

        public void addAdditionalPartyRole​(java.lang.String partyId,
                                           java.lang.String roleTypeId)
        Associates a party with a role to the order.
        Parameters:
        partyId - identifier of the party to associate to order
        roleTypeId - identifier of the role used in party-order association
      • removeAdditionalPartyRole

        public void removeAdditionalPartyRole​(java.lang.String partyId,
                                              java.lang.String roleTypeId)
        Removes a previously associated party to the order.
        Parameters:
        partyId - identifier of the party to associate to order
        roleTypeId - identifier of the role used in party-order association
      • getAdditionalPartyRoleMap

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getAdditionalPartyRoleMap()
      • getAggregatedInstanceId

        public java.lang.String getAggregatedInstanceId​(ShoppingCartItem item,
                                                        LocalDispatcher dispatcher)
        Returns the Id of an AGGREGATED_CONF product having exact configId. If AGGREGATED_CONF product do not exist, creates one, associates it to the AGGREGATED product, and copy its production run template.
        Parameters:
        item -
        dispatcher -
      • makeOrderItemGroups

        public java.util.List<GenericValue> makeOrderItemGroups()
      • explodeItems

        public void explodeItems​(java.util.List<ShoppingCartItem> shoppingCartItems,
                                 LocalDispatcher dispatcher)
        Does an "explode", or "unitize" operation on a list of cart items. Resulting state for each item with quantity X is X items of quantity 1.
        Parameters:
        shoppingCartItems -
        dispatcher -
      • makeOrderItems

        public java.util.List<GenericValue> makeOrderItems​(boolean explodeItems,
                                                           boolean replaceAggregatedId,
                                                           LocalDispatcher dispatcher)
      • makeWorkEfforts

        public java.util.List<GenericValue> makeWorkEfforts()
        create WorkEfforts from the shoppingcart items when itemType = RENTAL_ORDER_ITEM
      • makeAllAdjustments

        public java.util.List<GenericValue> makeAllAdjustments()
        make a list of all adjustments including order adjustments, order line adjustments, and special adjustments (shipping and tax if applicable)
      • makeAllQuoteAdjustments

        public java.util.List<GenericValue> makeAllQuoteAdjustments()
        make a list of all quote adjustments including header adjustments, line adjustments, and special adjustments (shipping and tax if applicable). Internally, the quote adjustments are created from the order adjustments.
      • makeAllOrderPaymentInfos

        public java.util.List<GenericValue> makeAllOrderPaymentInfos​(LocalDispatcher dispatcher)
        make a list of all OrderPaymentPreferences and Billing info including all payment methods and types
      • makeAllOrderItemPriceInfos

        public java.util.List<GenericValue> makeAllOrderItemPriceInfos()
        make a list of OrderItemPriceInfos from the ShoppingCartItems
      • makeProductPromoUses

        public java.util.List<GenericValue> makeProductPromoUses()
      • makeAllOrderItemSurveyResponses

        public java.util.List<GenericValue> makeAllOrderItemSurveyResponses()
        make a list of SurveyResponse object to update with order information set
      • makeAllOrderContactMechs

        public java.util.List<GenericValue> makeAllOrderContactMechs()
        make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItems
      • makeAllOrderItemContactMechs

        public java.util.List<GenericValue> makeAllOrderItemContactMechs()
        make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItems
      • makeAllShipGroupInfos

        public java.util.List<GenericValue> makeAllShipGroupInfos​(LocalDispatcher dispatcher)
        Return all OrderItemShipGroup, OrderContactMech, OrderAdjustment and OrderItemShipGroupAssoc from ShoppingCart in a single list of GenericValue
        Parameters:
        dispatcher -
        Returns:
      • getShipInfoSize

        public int getShipInfoSize()
      • makeAllOrderItemAttributes

        public java.util.List<GenericValue> makeAllOrderItemAttributes()
      • makeAllOrderItemAttributes

        public java.util.List<GenericValue> makeAllOrderItemAttributes​(java.lang.String orderId,
                                                                       int mode)
      • makeAllOrderAttributes

        public java.util.List<GenericValue> makeAllOrderAttributes()
      • makeAllOrderAttributes

        public java.util.List<GenericValue> makeAllOrderAttributes​(java.lang.String orderId,
                                                                   int mode)
      • makeAllOrderItemAssociations

        public java.util.List<GenericValue> makeAllOrderItemAssociations()
      • makeCartMap

        public java.util.Map<java.lang.String,​java.lang.Object> makeCartMap​(LocalDispatcher dispatcher,
                                                                                  boolean explodeItems)
        Returns a Map of cart values to pass to the storeOrder service
      • getLineListOrderedByBasePrice

        public java.util.List<ShoppingCartItem> getLineListOrderedByBasePrice​(boolean ascending)
      • getShipGroupsBySupplier

        public java.util.TreeMap<java.lang.Integer,​ShoppingCart.CartShipInfo> getShipGroupsBySupplier​(java.lang.String supplierPartyId)
      • createDropShipGroups

        public java.util.Map<java.lang.String,​java.lang.Object> createDropShipGroups​(LocalDispatcher dispatcher)
                                                                                    throws CartItemModifyException
        Examine each item of each ship group and create new ship groups if the item should be drop shipped
        Parameters:
        dispatcher -
        Throws:
        CartItemModifyException
      • getOrderAttributes

        public java.util.Map<java.lang.String,​java.lang.String> getOrderAttributes()
      • setOrderAttributes

        public void setOrderAttributes​(java.util.Map<java.lang.String,​java.lang.String> orderAttributes)
      • getOrderStatusId

        public java.lang.String getOrderStatusId()
      • setOrderStatusId

        public void setOrderStatusId​(java.lang.String orderStatusId)
      • getOrderStatusString

        public java.lang.String getOrderStatusString()
      • setOrderStatusString

        public void setOrderStatusString​(java.lang.String orderStatusString)