Class ShoppingCart

java.lang.Object
org.apache.ofbiz.order.shoppingcart.ShoppingCart
All Implemented Interfaces:
Serializable, Iterable<ShoppingCartItem>
Direct Known Subclasses:
WebShoppingCart

public class ShoppingCart extends Object implements Iterable<ShoppingCartItem>, Serializable
Shopping Cart Object
See Also:
  • Field Details

  • Constructor Details

    • ShoppingCart

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

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

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

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

      public ShoppingCart(Delegator delegator, String productStoreId, Locale locale, String currencyUom)
      Creates a new empty ShoppingCart object.
  • Method Details

    • getDelegator

      public Delegator getDelegator()
      get delegator
    • getProductStoreId

      public String getProductStoreId()
      get product store
    • getDoPromotions

      public boolean getDoPromotions()
      get do promotions
    • setDoPromotions

      public void setDoPromotions(boolean doPromotions)
      set do promotions
    • setProductStoreId

      public void setProductStoreId(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 String getTransactionId()
      get transaction id
    • setTransactionId

      public void setTransactionId(String transactionId)
      set transaction id
    • getTerminalId

      public String getTerminalId()
      get terminal id
    • setTerminalId

      public void setTerminalId(String terminalId)
      set terminal id
    • getAutoOrderShoppingListId

      public String getAutoOrderShoppingListId()
      get auto order shopping list id
    • setAutoOrderShoppingListId

      public void setAutoOrderShoppingListId(String autoOrderShoppingListId)
      set auto order shopping list id
    • getFacilityId

      public String getFacilityId()
      get facility id
    • setFacilityId

      public void setFacilityId(String facilityId)
      set facility id
    • getLocale

      public Locale getLocale()
      get locale
    • setLocale

      public void setLocale(Locale locale)
      set locale
    • setOrderName

      public void setOrderName(String orderName)
      set order name
    • getOrderName

      public String getOrderName()
      get order name
    • setWorkEffortId

      public void setWorkEffortId(String workEffortId)
      set work effort id
    • getWorkEffortId

      public String getWorkEffortId()
      get workeffort id
    • setAttribute

      public void setAttribute(String name, Object value)
      set attribute
    • removeAttribute

      public void removeAttribute(String name)
      remove attribute
    • getAttribute

      public <T> T getAttribute(String name)
      get attribute
    • removeOrderAttribute

      public void removeOrderAttribute(String name)
      remove order attribute
    • setOrderAttribute

      public void setOrderAttribute(String name, String value)
      set order attribute
    • getOrderAttribute

      public String getOrderAttribute(String name)
      get order attribute
    • setHoldOrder

      public void setHoldOrder(boolean b)
      set hold order
    • getHoldOrder

      public boolean getHoldOrder()
      get hold order
    • setOrderDate

      public void setOrderDate(Timestamp t)
      set order date
    • getOrderDate

      public Timestamp getOrderDate()
      get order date
    • setCurrency

      public void setCurrency(LocalDispatcher dispatcher, String currencyUom) throws CartItemModifyException
      Sets the currency for the cart.
      Throws:
      CartItemModifyException
    • getCurrency

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

      public Timestamp getCartCreatedTime()
      Gets cart created time.
      Returns:
      the cart created time
    • getSupplierProduct

      public GenericValue getSupplierProduct(String productId, BigDecimal quantity, LocalDispatcher dispatcher)
      Gets supplier product.
      Parameters:
      productId - the product id
      quantity - the quantity
      dispatcher - the dispatcher
      Returns:
      the supplier product
    • addOrIncreaseItem

      public int addOrIncreaseItem(String productId, BigDecimal selectedAmount, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String,GenericValue> features, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, String itemGroupNumber, 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(String productId, BigDecimal selectedAmount, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String,GenericValue> features, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, String itemGroupNumber, String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException
      add rental (with accommodation) item to cart
      Throws:
      CartItemModifyException
      ItemNotFoundException
    • addOrIncreaseItem

      public int addOrIncreaseItem(String productId, BigDecimal selectedAmount, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String,GenericValue> features, Map<String,Object> attributes, Map<String,String> orderItemAttributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, String itemGroupNumber, 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(String productId, BigDecimal selectedAmount, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Timestamp reserveAfterDate, Map<String,GenericValue> features, Map<String,Object> attributes, Map<String,String> orderItemAttributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, String itemGroupNumber, 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(String itemType, String description, String categoryId, BigDecimal price, BigDecimal quantity, Map<String,Object> attributes, String prodCatalogId, String itemGroupNumber, LocalDispatcher dispatcher) throws CartItemModifyException
      Add a non-product item to the shopping cart.
      Returns:
      the new item index
      Throws:
      CartItemModifyException
    • addItem

      public int addItem(int index, ShoppingCartItem item) throws CartItemModifyException
      Add an item to the shopping cart.
      Throws:
      CartItemModifyException
    • addItemToEnd

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

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

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

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

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

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

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

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

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

      public int addItemToEnd(ShoppingCartItem item) throws CartItemModifyException
      Add an item to the shopping cart.
      Throws:
      CartItemModifyException
    • findCartItem

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

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

      public List<ShoppingCartItem> findAllCartItems(String productId, 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 List<ShoppingCartItem> findAllCartItemsInCategory(String productCategoryId, 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.
    • removeExtraItems

      public void removeExtraItems(List<ShoppingCartItem> multipleItems, LocalDispatcher dispatcher, int maxItems) throws CartItemModifyException
      remove extra items
      Throws:
      CartItemModifyException
    • getItemsTotalQuantity

      public static BigDecimal getItemsTotalQuantity(List<ShoppingCartItem> cartItems)
    • getItemsProducts

      public static List<GenericValue> getItemsProducts(List<ShoppingCartItem> cartItems)
    • ensureItemsQuantity

      public void ensureItemsQuantity(List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, BigDecimal quantity) throws CartItemModifyException
      Ensure item total quantity
      Throws:
      CartItemModifyException
    • ensureItemsTotalQuantity

      public BigDecimal ensureItemsTotalQuantity(List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, BigDecimal quantity) throws CartItemModifyException
      Ensure item total quantity
      Throws:
      CartItemModifyException
    • containAnyWorkEffortCartItems

      public boolean containAnyWorkEffortCartItems()
      Contain any work effort cart items boolean.
      Returns:
      the boolean
    • containAllWorkEffortCartItems

      public boolean containAllWorkEffortCartItems()
      contain all work effort cart item check
    • 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(String orderItemSeqId)
      find an item from the cart object.
    • removeCartItem

      public void removeCartItem(ShoppingCartItem item, LocalDispatcher dispatcher) throws CartItemModifyException
      Remove an item from the cart object.
      Throws:
      CartItemModifyException
    • removeCartItem

      public void removeCartItem(int index, LocalDispatcher dispatcher) throws CartItemModifyException
      Remove an item from the cart object.
      Throws:
      CartItemModifyException
    • 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 List<ShoppingCartItem> items()
      Returns a Collection of items in the cart object.
    • iterator

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

      public ShoppingCart.ShoppingCartItemGroup getItemGroupByNumber(String groupNumber)
      Gets item group by number.
      Parameters:
      groupNumber - the group number
      Returns:
      the item group by number
    • addItemGroup

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

      public ShoppingCart.ShoppingCartItemGroup addItemGroup(GenericValue itemGroupValue) throws GenericEntityException
      Add item group shopping cart item group.
      Parameters:
      itemGroupValue - the item group value
      Returns:
      the shopping cart item group
      Throws:
      GenericEntityException - the generic entity exception
    • getCartItemsInNoGroup

      public List<ShoppingCartItem> getCartItemsInNoGroup()
      Gets cart items in no group.
      Returns:
      the cart items in no group
    • getCartItemsInGroup

      public List<ShoppingCartItem> getCartItemsInGroup(String groupNumber)
      Gets cart items in group.
      Parameters:
      groupNumber - the group number
      Returns:
      the cart items in group
    • deleteItemGroup

      public void deleteItemGroup(String groupNumber)
      Delete item group.
      Parameters:
      groupNumber - the group number
    • getUserLogin

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

      public void setUserLogin(GenericValue userLogin, LocalDispatcher dispatcher) throws CartItemModifyException
      Sets user login.
      Parameters:
      userLogin - the user login
      dispatcher - the dispatcher
      Throws:
      CartItemModifyException - the cart item modify exception
    • setUserLogin

      protected void setUserLogin(GenericValue userLogin)
      Sets user login.
      Parameters:
      userLogin - the user login
    • getAutoUserLogin

      public GenericValue getAutoUserLogin()
      Gets auto user login.
      Returns:
      the auto user login
    • setAutoUserLogin

      public void setAutoUserLogin(GenericValue autoUserLogin, LocalDispatcher dispatcher) throws CartItemModifyException
      Sets auto user login.
      Parameters:
      autoUserLogin - the auto user login
      dispatcher - the dispatcher
      Throws:
      CartItemModifyException - the cart item modify exception
    • setAutoUserLogin

      protected void setAutoUserLogin(GenericValue autoUserLogin)
      Sets auto user login.
      Parameters:
      autoUserLogin - the auto user login
    • handleNewUser

      public void handleNewUser(LocalDispatcher dispatcher) throws CartItemModifyException
      Handle new user.
      Parameters:
      dispatcher - the dispatcher
      Throws:
      CartItemModifyException - the cart item modify exception
    • getExternalId

      public String getExternalId()
      Gets external id.
      Returns:
      the external id
    • setExternalId

      public void setExternalId(String externalId)
      Sets external id.
      Parameters:
      externalId - the external id
    • getInternalCode

      public String getInternalCode()
      Gets internal code.
      Returns:
      the internal code
    • setInternalCode

      public void setInternalCode(String internalCode)
      Sets internal code.
      Parameters:
      internalCode - the internal code
    • getWebSiteId

      public String getWebSiteId()
      Gets web site id.
      Returns:
      the web site id
    • setWebSiteId

      public void setWebSiteId(String webSiteId)
      Sets web site id.
      Parameters:
      webSiteId - the web site id
    • setShipBeforeDate

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

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

      public 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 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, 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
    • getShipAfterDate

      public 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 Timestamp getShipAfterDate()
      Get ship after date for ship group 0
      Returns:
      return the ship after date for the first ship group
    • setShipAfterDate

      public void setShipAfterDate(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
    • setDefaultShipBeforeDate

      public void setDefaultShipBeforeDate(Timestamp defaultShipBeforeDate)
      Sets default ship before date.
      Parameters:
      defaultShipBeforeDate - the default ship before date
    • getDefaultShipBeforeDate

      public Timestamp getDefaultShipBeforeDate()
      Gets default ship before date.
      Returns:
      the default ship before date
    • setDefaultShipAfterDate

      public void setDefaultShipAfterDate(Timestamp defaultShipAfterDate)
      Sets default ship after date.
      Parameters:
      defaultShipAfterDate - the default ship after date
    • setCancelBackOrderDate

      public void setCancelBackOrderDate(Timestamp cancelBackOrderDate)
      Sets cancel back order date.
      Parameters:
      cancelBackOrderDate - the cancel back order date
    • getCancelBackOrderDate

      public Timestamp getCancelBackOrderDate()
      Gets cancel back order date.
      Returns:
      the cancel back order date
    • getDefaultShipAfterDate

      public Timestamp getDefaultShipAfterDate()
      Gets default ship after date.
      Returns:
      the default ship after date
    • setDefaultReserveAfterDate

      public void setDefaultReserveAfterDate(Timestamp defaultReserveAfterDate)
      Sets default reserve after date.
      Parameters:
      defaultReserveAfterDate - the default reserve after date
    • getDefaultReserveAfterDate

      public Timestamp getDefaultReserveAfterDate()
      Gets default reserve after date.
      Returns:
      the default reserve after date
    • getOrderPartyId

      public String getOrderPartyId()
      Gets order party id.
      Returns:
      the order party id
    • setOrderPartyId

      public void setOrderPartyId(String orderPartyId)
      Sets order party id.
      Parameters:
      orderPartyId - the order party id
    • getPlacingCustomerPartyId

      public String getPlacingCustomerPartyId()
      Gets placing customer party id.
      Returns:
      the placing customer party id
    • setPlacingCustomerPartyId

      public void setPlacingCustomerPartyId(String placingCustomerPartyId)
      Sets placing customer party id.
      Parameters:
      placingCustomerPartyId - the placing customer party id
    • getBillToCustomerPartyId

      public String getBillToCustomerPartyId()
      Gets bill to customer party id.
      Returns:
      the bill to customer party id
    • setBillToCustomerPartyId

      public void setBillToCustomerPartyId(String billToCustomerPartyId)
      Sets bill to customer party id.
      Parameters:
      billToCustomerPartyId - the bill to customer party id
    • getShipToCustomerPartyId

      public String getShipToCustomerPartyId()
      Gets ship to customer party id.
      Returns:
      the ship to customer party id
    • setShipToCustomerPartyId

      public void setShipToCustomerPartyId(String shipToCustomerPartyId)
      Sets ship to customer party id.
      Parameters:
      shipToCustomerPartyId - the ship to customer party id
    • getEndUserCustomerPartyId

      public String getEndUserCustomerPartyId()
      Gets end user customer party id.
      Returns:
      the end user customer party id
    • setEndUserCustomerPartyId

      public void setEndUserCustomerPartyId(String endUserCustomerPartyId)
      Sets end user customer party id.
      Parameters:
      endUserCustomerPartyId - the end user customer party id
    • getBillFromVendorPartyId

      public String getBillFromVendorPartyId()
      Gets bill from vendor party id.
      Returns:
      the bill from vendor party id
    • setBillFromVendorPartyId

      public void setBillFromVendorPartyId(String billFromVendorPartyId)
      Sets bill from vendor party id.
      Parameters:
      billFromVendorPartyId - the bill from vendor party id
    • getShipFromVendorPartyId

      public String getShipFromVendorPartyId()
      Gets ship from vendor party id.
      Returns:
      the ship from vendor party id
    • setShipFromVendorPartyId

      public void setShipFromVendorPartyId(String shipFromVendorPartyId)
      Sets ship from vendor party id.
      Parameters:
      shipFromVendorPartyId - the ship from vendor party id
    • getSupplierAgentPartyId

      public String getSupplierAgentPartyId()
      Gets supplier agent party id.
      Returns:
      the supplier agent party id
    • setSupplierAgentPartyId

      public void setSupplierAgentPartyId(String supplierAgentPartyId)
      Sets supplier agent party id.
      Parameters:
      supplierAgentPartyId - the supplier agent party id
    • getPartyId

      public String getPartyId()
      Gets party id.
      Returns:
      the party id
    • setAutoSaveListId

      public void setAutoSaveListId(String id)
      Sets auto save list id.
      Parameters:
      id - the id
    • getAutoSaveListId

      public String getAutoSaveListId()
      Gets auto save list id.
      Returns:
      the auto save list id
    • setLastListRestore

      public void setLastListRestore(Timestamp time)
      Sets last list restore.
      Parameters:
      time - the time
    • getLastListRestore

      public Timestamp getLastListRestore()
      Gets last list restore.
      Returns:
      the last list restore
    • getPartyDaysSinceCreated

      public BigDecimal getPartyDaysSinceCreated(Timestamp nowTimestamp)
      Gets party days since created.
      Parameters:
      nowTimestamp - the now timestamp
      Returns:
      the party days since created
    • clear

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

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

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

      public void setChannelType(String channelType)
      Sets channel type.
      Parameters:
      channelType - the channel type
    • getChannelType

      public String getChannelType()
      Gets channel type.
      Returns:
      the channel type
    • isPurchaseOrder

      public boolean isPurchaseOrder()
      Is purchase order boolean.
      Returns:
      the boolean
    • isSalesOrder

      public boolean isSalesOrder()
      Is sales order boolean.
      Returns:
      the boolean
    • setPoNumber

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

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

      public void setDefaultItemDeliveryDate(String date)
      Sets default item delivery date.
      Parameters:
      date - the date
    • getDefaultItemDeliveryDate

      public String getDefaultItemDeliveryDate()
      Gets default item delivery date.
      Returns:
      the default item delivery date
    • setDefaultItemComment

      public void setDefaultItemComment(String comment)
      Sets default item comment.
      Parameters:
      comment - the comment
    • getDefaultItemComment

      public String getDefaultItemComment()
      Gets default item comment.
      Returns:
      the default item comment
    • setAgreementId

      public void setAgreementId(String agreementId)
      Sets agreement id.
      Parameters:
      agreementId - the agreement id
    • getAgreementId

      public String getAgreementId()
      Gets agreement id.
      Returns:
      the agreement id
    • setQuoteId

      public void setQuoteId(String quoteId)
      Sets quote id.
      Parameters:
      quoteId - the quote id
    • getQuoteId

      public String getQuoteId()
      Gets quote id.
      Returns:
      the quote id
    • getPaymentMethodTypeId

      public String getPaymentMethodTypeId(String paymentMethodId)
      Gets payment method type id.
      Parameters:
      paymentMethodId - the payment method id
      Returns:
      the payment method type id
    • makePaymentInfo

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

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

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

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

      public ShoppingCart.CartPaymentInfo getPaymentInfo(int index)
      Locates an existing CartPaymentInfo object by index
    • getPaymentInfo

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

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

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

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

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

      public ShoppingCart.CartPaymentInfo addPaymentAmount(String id, BigDecimal amount)
      adds a payment method/payment method type
    • addPayment

      public ShoppingCart.CartPaymentInfo addPayment(String id)
      adds a payment method/payment method type
    • getPaymentAmount

      public BigDecimal getPaymentAmount(String id)
      returns the payment method/payment method type amount
    • addPaymentRef

      public void addPaymentRef(String id, String ref, String authCode)
      adds a payment ref
    • getPaymentRef

      public String getPaymentRef(String id)
      get a payment ref
    • getPaymentTotal

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

      public int selectedPayments()
      returns size of paymentInfo
    • isPaymentSelected

      public boolean isPaymentSelected(String id)
      is Payment Selected
    • clearPayment

      public void clearPayment(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(List<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 List<String> getPaymentMethodIds()
      Returns the Payment Method Ids
    • getPaymentMethodTypeIds

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

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

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

      public List<GenericValue> getCreditCards()
      getCreditCards
    • getGiftCards

      public List<GenericValue> getGiftCards()
      getGiftCards
    • isPaymentMethodType

      public boolean isPaymentMethodType(String id)
      determines if the id supplied is a payment method or not by searching in the entity engine
    • getBillingAddress

      public GenericValue getBillingAddress()
      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(String billingAccountId, BigDecimal amount)
      Sets the billing account id string.
    • getBillingAccountId

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

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

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

      public int addShipInfo()
      Add ship info int.
      Returns:
      the int
    • getShipGroups

      public List<ShoppingCart.CartShipInfo> getShipGroups()
      Gets ship groups.
      Returns:
      the ship groups
    • getShipGroups

      public Map<Integer,BigDecimal> getShipGroups(ShoppingCartItem item)
      Gets ship groups.
      Parameters:
      item - the item
      Returns:
      the ship groups
    • getShipGroups

      public Map<Integer,BigDecimal> getShipGroups(int itemIndex)
      Gets ship groups.
      Parameters:
      itemIndex - the item index
      Returns:
      the ship groups
    • getShipInfo

      public ShoppingCart.CartShipInfo getShipInfo(int idx)
      Gets ship info.
      Parameters:
      idx - the idx
      Returns:
      the ship info
    • getShipGroupSize

      public int getShipGroupSize()
      Gets ship group size.
      Returns:
      the ship group size
    • getShipGroupItems

      public Map<ShoppingCartItem,BigDecimal> getShipGroupItems(int idx)
      Returns the ShoppingCartItem (key) and quantity (value) associated with the ship group
    • clearItemShipInfo

      public void clearItemShipInfo(ShoppingCartItem item)
      Clear item ship info.
      Parameters:
      item - the item
    • setItemShipGroupEstimate

      public void setItemShipGroupEstimate(BigDecimal amount, int idx)
      Sets item ship group estimate.
      Parameters:
      amount - the amount
      idx - the 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 BigDecimal getItemShipGroupEstimate(int idx)
      Gets item ship group estimate.
      Parameters:
      idx - the idx
      Returns:
      the item ship group estimate
    • setItemShipGroupQty

      public void setItemShipGroupQty(int itemIndex, BigDecimal quantity, int idx)
      Sets item ship group qty.
      Parameters:
      itemIndex - the item index
      quantity - the quantity
      idx - the idx
    • setItemShipGroupQty

      public void setItemShipGroupQty(ShoppingCartItem item, BigDecimal quantity, int idx)
      Sets item ship group qty.
      Parameters:
      item - the item
      quantity - the quantity
      idx - the idx
    • setItemShipGroupQty

      public void setItemShipGroupQty(ShoppingCartItem item, int itemIndex, BigDecimal quantity, int idx)
      Sets item ship group qty.
      Parameters:
      item - the item
      itemIndex - the item index
      quantity - the quantity
      idx - the idx
    • getItemShipGroupQty

      public BigDecimal getItemShipGroupQty(ShoppingCartItem item, int idx)
      Gets item ship group qty.
      Parameters:
      item - the item
      idx - the idx
      Returns:
      the item ship group qty
    • getItemShipGroupQty

      public BigDecimal getItemShipGroupQty(int itemIndex, int idx)
      getItemShipGroupQty
    • positionItemToGroup

      public void positionItemToGroup(int itemIndex, BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
      positionItemToGroup
    • positionItemToGroup

      public void positionItemToGroup(ShoppingCartItem item, BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
      positionItemToGroup
    • checkShipItemInfo

      protected boolean checkShipItemInfo(ShoppingCart.CartShipInfo csi, ShoppingCart.CartShipInfo.CartShipItemInfo csii)
      checkShipItemInfo
    • cleanUpShipGroups

      public void cleanUpShipGroups()
      cleanUpShipGroups
    • getShipInfoIndex

      public int getShipInfoIndex(String shipGroupSeqId)
      getShipInfoIndex
    • getItemShipGroupIndex

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

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

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

      Parameters:
      shippingContactMechId -
    • getShippingContactMechId

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

      public String getShippingContactMechId()
      getShippingContactMechId
    • setShipmentMethodTypeId

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

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

      Parameters:
      shipmentMethodTypeId -
    • getShipmentMethodTypeId

      public String getShipmentMethodTypeId(int idx)
      Returns the shipment method type ID
    • getShipmentMethodTypeId

      public String getShipmentMethodTypeId()
      getShipmentMethodTypeId
    • getShipmentMethodType

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

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

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

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

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

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

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

      Parameters:
      shippingInstructions -
    • getShippingInstructions

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

      public String getShippingInstructions()
      getShippingInstructions
    • setMaySplit

      public void setMaySplit(int idx, Boolean maySplit)
      setMaySplit
    • setAllMaySplit

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

      Parameters:
      maySplit -
    • getMaySplit

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

      public String getMaySplit()
      Gets may split.
      Returns:
      the may split
    • setGiftMessage

      public void setGiftMessage(int idx, String giftMessage)
      Sets gift message.
      Parameters:
      idx - the idx
      giftMessage - the gift message
    • setAllGiftMessage

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

      Parameters:
      giftMessage -
    • getGiftMessage

      public String getGiftMessage(int idx)
      getGiftMessage
    • getGiftMessage

      public String getGiftMessage()
      getGiftMessage
    • setIsGift

      public void setIsGift(int idx, Boolean isGift)
      Sets is gift.
      Parameters:
      idx - the idx
      isGift - the is gift
    • setAllIsGift

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

      Parameters:
      isGift -
    • getIsGift

      public String getIsGift(int idx)
      Gets is gift.
      Parameters:
      idx - the idx
      Returns:
      the is gift
    • getIsGift

      public String getIsGift()
      Gets is gift.
      Returns:
      the is gift
    • setCarrierPartyId

      public void setCarrierPartyId(int idx, String carrierPartyId)
      Sets carrier party id.
      Parameters:
      idx - the idx
      carrierPartyId - the carrier party id
    • setAllCarrierPartyId

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

      Parameters:
      carrierPartyId -
    • getCarrierPartyId

      public String getCarrierPartyId(int idx)
      Gets carrier party id.
      Parameters:
      idx - the idx
      Returns:
      the carrier party id
    • getCarrierPartyId

      public String getCarrierPartyId()
      Gets carrier party id.
      Returns:
      the carrier party id
    • getProductStoreShipMethId

      public String getProductStoreShipMethId(int idx)
      Gets product store ship meth id.
      Parameters:
      idx - the idx
      Returns:
      the product store ship meth id
    • getProductStoreShipMethId

      public String getProductStoreShipMethId()
      Gets product store ship meth id.
      Returns:
      the product store ship meth id
    • setProductStoreShipMethId

      public void setProductStoreShipMethId(int idx, String productStoreShipMethId)
      Sets product store ship meth id.
      Parameters:
      idx - the idx
      productStoreShipMethId - the product store ship meth id
    • setAllProductStoreShipMethId

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

      Parameters:
      productStoreShipMethId -
    • setShipGroupFacilityId

      public void setShipGroupFacilityId(int idx, String facilityId)
      Sets ship group facility id.
      Parameters:
      idx - the idx
      facilityId - the facility id
    • getShipGroupFacilityId

      public String getShipGroupFacilityId(int idx)
      Gets ship group facility id.
      Parameters:
      idx - the idx
      Returns:
      the ship group facility id
    • setShipGroupVendorPartyId

      public void setShipGroupVendorPartyId(int idx, String vendorPartyId)
      Sets ship group vendor party id.
      Parameters:
      idx - the idx
      vendorPartyId - the vendor party id
    • getShipGroupVendorPartyId

      public String getShipGroupVendorPartyId(int idx)
      Gets ship group vendor party id.
      Parameters:
      idx - the idx
      Returns:
      the ship group vendor party id
    • setShipGroupSeqId

      public void setShipGroupSeqId(int idx, String shipGroupSeqId)
      Sets ship group seq id.
      Parameters:
      idx - the idx
      shipGroupSeqId - the ship group seq id
    • getShipGroupSeqId

      public String getShipGroupSeqId(int idx)
      Gets ship group seq id.
      Parameters:
      idx - the idx
      Returns:
      the ship group seq id
    • setOrderAdditionalEmails

      public void setOrderAdditionalEmails(String orderAdditionalEmails)
      Sets order additional emails.
      Parameters:
      orderAdditionalEmails - the order additional emails
    • getOrderAdditionalEmails

      public String getOrderAdditionalEmails()
      Gets order additional emails.
      Returns:
      the order additional emails
    • getShippingAddress

      public GenericValue getShippingAddress(int idx)
      Gets shipping address.
      Parameters:
      idx - the idx
      Returns:
      the shipping address
    • getOriginAddress

      public GenericValue getOriginAddress(int idx)
      Gets origin address.
      Parameters:
      idx - the idx
      Returns:
      the origin address
    • getShippingAddress

      public GenericValue getShippingAddress()
      Gets shipping address.
      Returns:
      the shipping address
    • getInternalOrderNotes

      public List<String> getInternalOrderNotes()
      Gets internal order notes.
      Returns:
      the internal order notes
    • getOrderNotes

      public List<String> getOrderNotes()
      Gets order notes.
      Returns:
      the order notes
    • addInternalOrderNote

      public void addInternalOrderNote(String note)
      Add internal order note.
      Parameters:
      note - the note
    • clearInternalOrderNotes

      public void clearInternalOrderNotes()
      Clear internal order notes.
    • clearOrderNotes

      public void clearOrderNotes()
      Clear order notes.
    • addOrderNote

      public void addOrderNote(String note)
      Add order note.
      Parameters:
      note - the note
    • setDefaultCheckoutOptions

      public void setDefaultCheckoutOptions(LocalDispatcher dispatcher)
      Preset with default values some of the checkout options to get a quicker checkout process.
    • getTotalSalesTax

      public BigDecimal getTotalSalesTax(int shipGroup)
      Returns the tax amount for a ship group.
    • getTotalSalesTax

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

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

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

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

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

      public BigDecimal getDisplaySubTotal()
      Gets display sub total.
      Returns:
      the display sub total
    • getOrderGlobalAdjustments

      public BigDecimal getOrderGlobalAdjustments()
      Gets order global adjustments.
      Returns:
      the order global adjustments
    • getDisplayTaxIncluded

      public BigDecimal getDisplayTaxIncluded()
      Gets display tax included.
      Returns:
      the display tax included
    • getDisplayRecurringSubTotal

      public BigDecimal getDisplayRecurringSubTotal()
      Gets display recurring sub total.
      Returns:
      the display recurring sub total
    • getDisplayGrandTotal

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

      public BigDecimal getOrderOtherAdjustmentTotal()
      Gets order other adjustment total.
      Returns:
      the order other adjustment total
    • getSubTotalForPromotions

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

      public BigDecimal getSubTotalForPromotions(Set<String> productIds)
      Gets sub total for promotions.
      Parameters:
      productIds - the product ids
      Returns:
      the sub total for promotions
    • getOrderPaymentPreferenceTotalByType

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

      public BigDecimal getCreditCardPaymentPreferenceTotal()
      Gets credit card payment preference total.
      Returns:
      the credit card payment preference total
    • getBillingAccountPaymentPreferenceTotal

      public BigDecimal getBillingAccountPaymentPreferenceTotal()
      Gets billing account payment preference total.
      Returns:
      the billing account payment preference total
    • getGiftCardPaymentPreferenceTotal

      public BigDecimal getGiftCardPaymentPreferenceTotal()
      Gets gift card payment preference total.
      Returns:
      the gift card payment preference total
    • addContactMech

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

      public String getContactMech(String contactMechPurposeTypeId)
      Get the contactMechId for this cart given the contactMechPurposeTypeId
    • removeContactMech

      public String removeContactMech(String contactMechPurposeTypeId)
      Remove the contactMechId from this cart given the contactMechPurposeTypeId
    • getOrderContactMechIds

      public Map<String,String> getOrderContactMechIds()
      Gets order contact mech ids.
      Returns:
      the order contact mech ids
    • getAdjustments

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

      public int getAdjustmentPromoIndex(String productPromoId)
      Gets adjustment promo index.
      Parameters:
      productPromoId - the product promo id
      Returns:
      the adjustment promo index
    • 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)
      Remove adjustment.
      Parameters:
      index - the index
    • getAdjustment

      public GenericValue getAdjustment(int index)
      Gets adjustment.
      Parameters:
      index - the index
      Returns:
      the adjustment
    • getOrderTerms

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

      public int addOrderTerm(String termTypeId, BigDecimal termValue, Long termDays)
      Add an orderTerm to the order
    • addOrderTerm

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

      public int addOrderTerm(String termTypeId, String orderItemSeqId, BigDecimal termValue, Long termDays, String textValue, String description)
      Add order term int.
      Parameters:
      termTypeId - the term type id
      orderItemSeqId - the order item seq id
      termValue - the term value
      termDays - the term days
      textValue - the text value
      description - the description
      Returns:
      the int
    • addOrderTerm

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

      public void removeOrderTerm(int index)
      Remove order term.
      Parameters:
      index - the index
    • removeOrderTerms

      public void removeOrderTerms()
      Remove order terms.
    • isOrderTermSet

      public boolean isOrderTermSet()
      Is order term set boolean.
      Returns:
      the boolean
    • setOrderTermSet

      public void setOrderTermSet(boolean orderTermSet)
      Sets order term set.
      Parameters:
      orderTermSet - the order term set
    • hasOrderTerm

      public boolean hasOrderTerm(String termTypeId)
      Has order term boolean.
      Parameters:
      termTypeId - the term type id
      Returns:
      the boolean
    • isReadOnlyCart

      public boolean isReadOnlyCart()
      Is read only cart boolean.
      Returns:
      the boolean
    • setReadOnlyCart

      public void setReadOnlyCart(boolean readOnlyCart)
      Sets read only cart.
      Parameters:
      readOnlyCart - the read only cart
    • removeAdjustmentByType

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

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

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

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

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

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

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

      public List<Map<String,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 Map<String,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 String getOrderId()
      Returns the order ID associated with this cart or null if no order has been created yet.
    • getFirstAttemptOrderId

      public 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(String orderId)
      Sets the orderId associated with this cart.
    • setNextItemSeq

      public void setNextItemSeq(long seq) throws GeneralException
      set next item seq
      Throws:
      GeneralException
    • setFirstAttemptOrderId

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

      public void removeAllFreeShippingProductPromoActions()
      remove all free shipping product promo action
    • 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 List<GenericValue> getFreeShippingProductPromoActions()
      get free shipping product promo action
    • removeAllDesiredAlternateGiftByActions

      public void removeAllDesiredAlternateGiftByActions()
      remove all desired alternative gift by action
    • setDesiredAlternateGiftByAction

      public void setDesiredAlternateGiftByAction(GenericPK productPromoActionPK, String productId)
      set all desired alternative gift by action
    • getDesiredAlternateGiftByAction

      public String getDesiredAlternateGiftByAction(GenericPK productPromoActionPK)
      get desired alternate gift by action
    • getAllDesiredAlternateGiftByActionCopy

      public Map<GenericPK,String> getAllDesiredAlternateGiftByActionCopy()
      get all desired alternative gift by action copy
    • addProductPromoUse

      public void addProductPromoUse(String productPromoId, String productPromoCodeId, BigDecimal totalDiscountAmount, BigDecimal quantityLeftInActions, Map<ShoppingCartItem,BigDecimal> usageInfoMap)
      add product promo use
    • removeProductPromoUse

      public void removeProductPromoUse(String productPromoId)
      remove product promo use
    • clearProductPromoUseInfo

      public void clearProductPromoUseInfo()
      clear out info for general promo use
    • clearCartItemUseInPromoInfo

      public void clearCartItemUseInPromoInfo()
      clear cart item use in promo info
    • getProductPromoUseInfoIter

      public Iterator<ShoppingCart.ProductPromoUseInfo> getProductPromoUseInfoIter()
      get product promo use info iter
    • getProductPromoTotal

      public BigDecimal getProductPromoTotal()
      get product promo total
    • getProductPromoUseTotalDiscount

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

      public int getProductPromoUseCount(String productPromoId)
      get product promo use count
    • getProductPromoCodeUse

      public int getProductPromoCodeUse(String productPromoCodeId)
      get product promo code use
    • clearAllPromotionInformation

      public void clearAllPromotionInformation()
      clear all promotion information
    • clearAllPromotionAdjustments

      public void clearAllPromotionAdjustments()
      clear all promotion adjustments
    • clearAllAdjustments

      public void clearAllAdjustments()
      clear all adjustments
    • clearAllItemStatus

      public void clearAllItemStatus()
      clear all item status
    • addProductPromoCode

      public String addProductPromoCode(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 Set<String> getProductPromoCodesEntered()
      get product promo codes entered
    • resetPromoRuleUse

      public void resetPromoRuleUse(String productPromoId, String productPromoRuleId)
      reset promo rule use
    • confirmPromoRuleUse

      public void confirmPromoRuleUse(String productPromoId, String productPromoRuleId)
      confirm promo rule use
    • addAdditionalPartyRole

      public void addAdditionalPartyRole(String partyId, 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(String partyId, 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 Map<String,List<String>> getAdditionalPartyRoleMap()
      get additional party role map
    • getAggregatedInstanceId

      public 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 List<GenericValue> makeOrderItemGroups()
      make order item groups
    • explodeItems

      public void explodeItems(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 List<GenericValue> makeOrderItems(LocalDispatcher dispatcher)
      make order items
    • makeOrderItems

      public List<GenericValue> makeOrderItems(boolean explodeItems, boolean replaceAggregatedId, LocalDispatcher dispatcher)
      make order items
    • makeWorkEfforts

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

      public 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 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 List<GenericValue> makeAllOrderPaymentInfos(LocalDispatcher dispatcher)
      make a list of all OrderPaymentPreferences and Billing info including all payment methods and types
    • makeAllOrderItemPriceInfos

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

      public List<GenericValue> makeProductPromoUses()
      make product promo uses
    • makeAllOrderItemSurveyResponses

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

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

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

      public 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()
      get ship info size
    • makeAllOrderItemAttributes

      public List<GenericValue> makeAllOrderItemAttributes()
      make All Order Item Attributes
    • makeAllOrderItemAttributes

      public List<GenericValue> makeAllOrderItemAttributes(String orderId, int mode)
      make All Order Item Attributes
    • makeAllOrderAttributes

      public List<GenericValue> makeAllOrderAttributes()
      make All Order Attributes
    • makeAllOrderAttributes

      public List<GenericValue> makeAllOrderAttributes(String orderId, int mode)
      make all order attributes
    • makeAllOrderItemAssociations

      public List<GenericValue> makeAllOrderItemAssociations()
      make all order item associations
    • makeCartMap

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

      public List<ShoppingCartItem> getLineListOrderedByBasePrice(boolean ascending)
      get line list ordered by base price
    • getShipGroupsBySupplier

      public TreeMap<Integer,ShoppingCart.CartShipInfo> getShipGroupsBySupplier(String supplierPartyId)
      get ship groups by supplier
    • createDropShipGroups

      public Map<String,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 Map<String,String> getOrderAttributes()
      get order attributes
    • setOrderAttributes

      public void setOrderAttributes(Map<String,String> orderAttributes)
      set order attributes
    • getOrderStatusId

      public String getOrderStatusId()
      get order status id
    • setOrderStatusId

      public void setOrderStatusId(String orderStatusId)
      set order status id
    • getOrderStatusString

      public String getOrderStatusString()
      get order status string
    • setOrderStatusString

      public void setOrderStatusString(String orderStatusString)
      set order status string
    • getMinimumOrderQuantity

      public static BigDecimal getMinimumOrderQuantity(Delegator delegator, BigDecimal itemBasePrice, String itemProductId) throws GenericEntityException
      Throws:
      GenericEntityException