Class ShoppingCartItem

java.lang.Object
org.apache.ofbiz.order.shoppingcart.ShoppingCartItem
All Implemented Interfaces:
Serializable

public class ShoppingCartItem extends Object implements Serializable

Title: ShoppingCartItem.java

Description: Shopping cart item object.

See Also:
  • Field Details

    • GEN_ROUNDING

      public static final MathContext GEN_ROUNDING
    • ATTRIBUTE_NAMES

      protected static final String[] ATTRIBUTE_NAMES
  • Constructor Details

  • Method Details

    • makePurchaseOrderItem

      public static ShoppingCartItem makePurchaseOrderItem(Integer cartLocation, String productId, BigDecimal selectedAmount, BigDecimal quantity, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, GenericValue supplierProduct, Timestamp shipBeforeDate, Timestamp shipAfterDate, Timestamp cancelBackOrderDate) throws CartItemModifyException, ItemNotFoundException
      Makes a ShoppingCartItem for a purchase order item and adds it to the cart. NOTE: This method will get the product entity and check to make sure it can be purchased.
      Parameters:
      cartLocation - The location to place this item; null will place at the end
      productId - The primary key of the product being added
      quantity - The quantity to add
      additionalProductFeatureAndAppls - Product feature/appls map
      attributes - All unique attributes for this item (NOT features)
      prodCatalogId - The catalog this item was added from
      configWrapper - The product configuration wrapper (null if the product is not configurable)
      dispatcher - LocalDispatcher object for doing promotions, etc
      cart - The parent shopping cart object this item will belong to
      supplierProduct - GenericValue of SupplierProduct entity, containing product description and prices
      shipBeforeDate - Request that the shipment be made before this date
      shipAfterDate - Request that the shipment be made after this date
      cancelBackOrderDate - The date which if crossed causes order cancellation
      Returns:
      a new ShoppingCartItem object
      Throws:
      CartItemModifyException
      ItemNotFoundException
    • makeItem

      public static ShoppingCartItem makeItem(Integer cartLocation, String productId, BigDecimal selectedAmount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, String parentProductId, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
      Makes a ShoppingCartItem and adds it to the cart. NOTE: This method will get the product entity and check to make sure it can be purchased.
      Parameters:
      cartLocation - The location to place this item; null will place at the end
      productId - The primary key of the product being added
      selectedAmount - Optional. Defaults to 0.0. If a selectedAmount is needed (complements the quantity value), pass it in here.
      quantity - Required. The quantity to add.
      unitPrice - Optional. Defaults to 0.0, which causes calculation of price.
      reservStart - Optional. The start of the reservation.
      reservLength - Optional. The length of the reservation.
      reservPersons - Optional. The number of persons taking advantage of the reservation.
      shipBeforeDate - Optional. The date to ship the order by.
      shipAfterDate - Optional. Wait until this date to ship.
      additionalProductFeatureAndAppls - Optional. Product feature/appls map.
      attributes - Optional. All unique attributes for this item (NOT features).
      prodCatalogId - Optional, but strongly recommended. The catalog this item was added from.
      configWrapper - Optional. The product configuration wrapper (null if the product is not configurable).
      itemType - Optional. Specifies the type of cart item, corresponds to an OrderItemType and should be a valid orderItemTypeId.
      itemGroup - Optional. Specifies which item group in the cart this should belong to, if item groups are needed/desired.
      dispatcher - Required (for price calculation, promos, etc). LocalDispatcher object for doing promotions, etc.
      cart - Required. The parent shopping cart object this item will belong to.
      triggerExternalOpsBool - Optional. Defaults to true. Trigger external operations (like promotions and such)?
      triggerPriceRulesBool - Optional. Defaults to true. Trigger the price rules to calculate the price for this item?
      Returns:
      a new ShoppingCartItem object
      Throws:
      CartItemModifyException
      ItemNotFoundException
    • makeItem

      public static ShoppingCartItem makeItem(Integer cartLocation, String productId, BigDecimal selectedAmount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, String parentProductId, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
      Throws:
      CartItemModifyException
      ItemNotFoundException
    • makeItem

      public static ShoppingCartItem makeItem(Integer cartLocation, String productId, BigDecimal selectedAmount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Timestamp reserveAfterDate, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, String parentProductId, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
      Makes a ShoppingCartItem and adds it to the cart.
      Parameters:
      accommodationMapId - Optional. reservations add into workeffort
      accommodationSpotId - Optional. reservations add into workeffort
      Throws:
      CartItemModifyException
      ItemNotFoundException
    • makeItem

      public static ShoppingCartItem makeItem(Integer cartLocation, GenericValue product, BigDecimal selectedAmount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, GenericValue parentProduct, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException
      Makes a ShoppingCartItem and adds it to the cart. WARNING: This method does not check if the product is in a purchase category. rental fields were added.
      Parameters:
      cartLocation - The location to place this item; null will place at the end
      product - The product entity relating to the product being added
      selectedAmount - Optional. Defaults to 0.0. If a selectedAmount is needed (complements the quantity value), pass it in here.
      quantity - Required. The quantity to add.
      unitPrice - Optional. Defaults to 0.0, which causes calculation of price.
      reservStart - Optional. The start of the reservation.
      reservLength - Optional. The length of the reservation.
      reservPersons - Optional. The number of persons taking advantage of the reservation.
      shipBeforeDate - Optional. The date to ship the order by.
      shipAfterDate - Optional. Wait until this date to ship.
      additionalProductFeatureAndAppls - Optional. Product feature/appls map.
      attributes - Optional. All unique attributes for this item (NOT features).
      prodCatalogId - Optional, but strongly recommended. The catalog this item was added from.
      configWrapper - Optional. The product configuration wrapper (null if the product is not configurable).
      itemType - Optional. Specifies the type of cart item, corresponds to an OrderItemType and should be a valid orderItemTypeId.
      itemGroup - Optional. Specifies which item group in the cart this should belong to, if item groups are needed/desired.
      dispatcher - Required (for price calculation, promos, etc). LocalDispatcher object for doing promotions, etc.
      cart - Required. The parent shopping cart object this item will belong to.
      triggerExternalOpsBool - Optional. Defaults to true. Trigger external operations (like promotions and such)?
      triggerPriceRulesBool - Optional. Defaults to true. Trigger the price rules to calculate the price for this item?
      Returns:
      a new ShoppingCartItem object
      Throws:
      CartItemModifyException
    • makeItem

      public static ShoppingCartItem makeItem(Integer cartLocation, GenericValue product, BigDecimal selectedAmount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Timestamp reserveAfterDate, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, GenericValue parentProduct, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException
      Makes a ShoppingCartItem and adds it to the cart.
      Parameters:
      accommodationMapId - Optional. reservations add into workeffort
      accommodationSpotId - Optional. reservations add into workeffort
      Throws:
      CartItemModifyException
    • findProduct

      public static GenericValue findProduct(Delegator delegator, boolean skipProductChecks, String prodCatalogId, String productId, Locale locale) throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • isValidCartProduct

      public static void isValidCartProduct(ProductConfigWrapper configWrapper, GenericValue product, Timestamp nowTimestamp, Locale locale) throws CartItemModifyException
      Throws:
      CartItemModifyException
    • makeItem

      public static ShoppingCartItem makeItem(Integer cartLocation, String itemType, String itemDescription, String productCategoryId, BigDecimal basePrice, BigDecimal selectedAmount, BigDecimal quantity, Map<String,Object> attributes, String prodCatalogId, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool) throws CartItemModifyException
      Makes a non-product ShoppingCartItem and adds it to the cart. NOTE: This is only for non-product items; items without a product entity (work items, bulk items, etc)
      Parameters:
      cartLocation - The location to place this item; null will place at the end
      itemType - The OrderItemTypeId for the item being added
      itemDescription - The optional description of the item
      productCategoryId - The optional category the product *will* go in
      basePrice - The price for this item
      selectedAmount -
      quantity - The quantity to add
      attributes - All unique attributes for this item (NOT features)
      prodCatalogId - The catalog this item was added from
      dispatcher - LocalDispatcher object for doing promotions, etc
      cart - The parent shopping cart object this item will belong to
      triggerExternalOpsBool - Indicates if we should run external operations (promotions, auto-save, etc)
      Returns:
      a new ShoppingCartItem object
      Throws:
      CartItemModifyException
    • checkAvailability

      public static String checkAvailability(String productId, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, ShoppingCart cart)
      returns "OK" when the product can be booked or returns a string with the dates the related fixed Asset is not available
    • getPurchaseOrderItemDescription

      public static String getPurchaseOrderItemDescription(GenericValue product, GenericValue supplierProduct, Locale locale, LocalDispatcher dispatcher)
    • getProdCatalogId

      public String getProdCatalogId()
      Gets prod catalog id.
      Returns:
      the prod catalog id
    • 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
    • getSelectedAmount

      public BigDecimal getSelectedAmount()
      Returns the user selected amount
    • setSelectedAmount

      public void setSelectedAmount(BigDecimal selectedAmount)
      Sets the user selected amount
    • setAccommodationId

      public void setAccommodationId(String accommodationMapId, String accommodationSpotId)
      Sets accommodationId using the reservation
    • setQuantity

      public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart) throws CartItemModifyException
      Sets the quantity for the item and validates the change in quantity, etc
      Throws:
      CartItemModifyException
    • setQuantity

      public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps) throws CartItemModifyException
      Sets the quantity for the item and validates the change in quantity, etc
      Throws:
      CartItemModifyException
    • setQuantity

      public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup) throws CartItemModifyException
      Sets the quantity for the item and validates the change in quantity, etc
      Throws:
      CartItemModifyException
    • setQuantity

      public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup, boolean updateProductPrice) throws CartItemModifyException
      Sets the quantity for the item and validates the change in quantity, etc
      Throws:
      CartItemModifyException
    • isInventoryAvailableOrNotRequired

      protected boolean isInventoryAvailableOrNotRequired(BigDecimal quantity, String productStoreId, LocalDispatcher dispatcher) throws CartItemModifyException
      Is inventory available or not required boolean.
      Parameters:
      quantity - the quantity
      productStoreId - the product store id
      dispatcher - the dispatcher
      Returns:
      the boolean
      Throws:
      CartItemModifyException - the cart item modify exception
    • setQuantity

      protected void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup, boolean updateProductPrice, boolean skipInventoryChecks) throws CartItemModifyException
      Sets quantity.
      Parameters:
      quantity - the quantity
      dispatcher - the dispatcher
      cart - the cart
      triggerExternalOps - the trigger external ops
      resetShipGroup - the reset ship group
      updateProductPrice - the update product price
      skipInventoryChecks - the skip inventory checks
      Throws:
      CartItemModifyException - the cart item modify exception
    • calcDepositAdjustments

      public void calcDepositAdjustments()
      Calc deposit adjustments.
    • updatePrice

      public void updatePrice(LocalDispatcher dispatcher, ShoppingCart cart) throws CartItemModifyException
      Update price.
      Parameters:
      dispatcher - the dispatcher
      cart - the cart
      Throws:
      CartItemModifyException - the cart item modify exception
    • getQuantity

      public BigDecimal getQuantity()
      Returns the quantity.
    • getReservStart

      public Timestamp getReservStart()
      Returns the reservation start date.
    • setReservStart

      public void setReservStart(Timestamp reservStart)
      Sets the reservation start date
    • getReservStart

      public Timestamp getReservStart(BigDecimal addDays)
      Returns the reservation start date with a number of days added.
    • getReservLength

      public BigDecimal getReservLength()
      Returns the reservation length.
    • setReservLength

      public void setReservLength(BigDecimal reservLength)
      Sets the reservation length
    • getReservPersons

      public BigDecimal getReservPersons()
      Returns the reservation number of persons.
    • setReservPersons

      public void setReservPersons(BigDecimal reservPersons)
      Sets number of persons using the reservation
    • getAccommodationMapId

      public String getAccommodationMapId()
      Returns accommodationMapId
    • getAccommodationSpotId

      public String getAccommodationSpotId()
      Returns accommodationSpotId
    • getPromoQuantityUsed

      public BigDecimal getPromoQuantityUsed()
      Gets promo quantity used.
      Returns:
      the promo quantity used
    • getPromoQuantityAvailable

      public BigDecimal getPromoQuantityAvailable()
      Gets promo quantity available.
      Returns:
      the promo quantity available
    • getQuantityUsedPerPromoActualIter

      public Iterator<Map.Entry<GenericPK,BigDecimal>> getQuantityUsedPerPromoActualIter()
      Gets quantity used per promo actual iter.
      Returns:
      the quantity used per promo actual iter
    • getQuantityUsedPerPromoCandidateIter

      public Iterator<Map.Entry<GenericPK,BigDecimal>> getQuantityUsedPerPromoCandidateIter()
      Gets quantity used per promo candidate iter.
      Returns:
      the quantity used per promo candidate iter
    • getQuantityUsedPerPromoFailedIter

      public Iterator<Map.Entry<GenericPK,BigDecimal>> getQuantityUsedPerPromoFailedIter()
      Gets quantity used per promo failed iter.
      Returns:
      the quantity used per promo failed iter
    • addPromoQuantityCandidateUse

      public BigDecimal addPromoQuantityCandidateUse(BigDecimal quantityDesired, GenericValue productPromoCondAction, boolean checkAvailableOnly)
      Add promo quantity candidate use big decimal.
      Parameters:
      quantityDesired - the quantity desired
      productPromoCondAction - the product promo cond action
      checkAvailableOnly - the check available only
      Returns:
      the big decimal
    • getPromoQuantityCandidateUse

      public BigDecimal getPromoQuantityCandidateUse(GenericValue productPromoCondAction)
      Gets promo quantity candidate use.
      Parameters:
      productPromoCondAction - the product promo cond action
      Returns:
      the promo quantity candidate use
    • getPromoQuantityCandidateUseActionAndAllConds

      public BigDecimal getPromoQuantityCandidateUseActionAndAllConds(GenericValue productPromoAction)
      Gets promo quantity candidate use action and all conds.
      Parameters:
      productPromoAction - the product promo action
      Returns:
      the promo quantity candidate use action and all conds
    • resetPromoRuleUse

      public void resetPromoRuleUse(String productPromoId, String productPromoRuleId)
      Reset promo rule use.
      Parameters:
      productPromoId - the product promo id
      productPromoRuleId - the product promo rule id
    • confirmPromoRuleUse

      public void confirmPromoRuleUse(String productPromoId, String productPromoRuleId)
      Confirm promo rule use.
      Parameters:
      productPromoId - the product promo id
      productPromoRuleId - the product promo rule id
    • clearPromoRuleUseInfo

      public void clearPromoRuleUseInfo()
      Clear promo rule use info.
    • getItemComment

      public String getItemComment()
      Returns the item's comment.
    • setItemComment

      public void setItemComment(String itemComment)
      Sets the item comment.
    • getDesiredDeliveryDate

      public Timestamp getDesiredDeliveryDate()
      Returns the item's customer desired delivery date.
    • setDesiredDeliveryDate

      public void setDesiredDeliveryDate(Timestamp ddDate)
      Sets the item's customer desired delivery date.
    • getShipBeforeDate

      public Timestamp getShipBeforeDate()
      Returns the date to ship before
    • setShipBeforeDate

      public void setShipBeforeDate(Timestamp date)
      Sets the date to ship before
    • getShipAfterDate

      public Timestamp getShipAfterDate()
      Returns the date to ship after
    • setShipAfterDate

      public void setShipAfterDate(Timestamp date)
      Sets the date to ship after
    • getReserveAfterDate

      public Timestamp getReserveAfterDate()
      Returns the date to ship after
    • setReserveAfterDate

      public void setReserveAfterDate(Timestamp date)
      Sets the date to ship after
    • getCancelBackOrderDate

      public Timestamp getCancelBackOrderDate()
      Returns the cancel back order date
    • setCancelBackOrderDate

      public void setCancelBackOrderDate(Timestamp date)
      Sets the cancel back order date
    • getEstimatedShipDate

      public Timestamp getEstimatedShipDate()
      Returns the date to EstimatedShipDate
    • setEstimatedShipDate

      public void setEstimatedShipDate(Timestamp date)
      Sets the date to EstimatedShipDate
    • getItemType

      public String getItemType()
      Returns the item type.
    • setItemType

      public void setItemType(String itemType)
      Sets the item type.
    • getItemTypeGenericValue

      public GenericValue getItemTypeGenericValue()
      Returns the item type.
    • setItemGroup

      public void setItemGroup(String groupNumber, ShoppingCart cart)
      Sets the item group.
    • getItemGroup

      public ShoppingCart.ShoppingCartItemGroup getItemGroup()
      Returns the item group.
    • setItemGroup

      public void setItemGroup(ShoppingCart.ShoppingCartItemGroup itemGroup)
      Sets the item group.
    • isInItemGroup

      public boolean isInItemGroup(String groupNumber)
      Is in item group boolean.
      Parameters:
      groupNumber - the group number
      Returns:
      the boolean
    • getItemTypeDescription

      public String getItemTypeDescription()
      Returns the item type description.
    • getProductCategoryId

      public String getProductCategoryId()
      Returns the productCategoryId for the item or null if none.
    • setProductCategoryId

      public void setProductCategoryId(String productCategoryId)
      Sets product category id.
      Parameters:
      productCategoryId - the product category id
    • getOrderItemSeqId

      public String getOrderItemSeqId()
      Gets order item seq id.
      Returns:
      the order item seq id
    • setOrderItemSeqId

      public void setOrderItemSeqId(String orderItemSeqId)
      Sets order item seq id.
      Parameters:
      orderItemSeqId - the order item seq id
    • setShoppingList

      public void setShoppingList(String shoppingListId, String itemSeqId)
      Sets shopping list.
      Parameters:
      shoppingListId - the shopping list id
      itemSeqId - the item seq id
    • getShoppingListId

      public String getShoppingListId()
      Gets shopping list id.
      Returns:
      the shopping list id
    • getShoppingListItemSeqId

      public String getShoppingListItemSeqId()
      Gets shopping list item seq id.
      Returns:
      the shopping list item seq id
    • getRequirementId

      public String getRequirementId()
      Returns the requirementId.
    • setRequirementId

      public void setRequirementId(String requirementId)
      Sets the requirementId.
    • getQuoteId

      public String getQuoteId()
      Returns the quoteId.
    • setQuoteId

      public void setQuoteId(String quoteId)
      Sets the quoteId.
    • getQuoteItemSeqId

      public String getQuoteItemSeqId()
      Returns the quoteItemSeqId.
    • setQuoteItemSeqId

      public void setQuoteItemSeqId(String quoteItemSeqId)
      Sets the quoteItemSeqId.
    • getOrderItemAssocTypeId

      public String getOrderItemAssocTypeId()
      Returns the OrderItemAssocTypeId.
    • setOrderItemAssocTypeId

      public void setOrderItemAssocTypeId(String orderItemAssocTypeId)
      Sets the orderItemAssocTypeId.
    • getAssociatedOrderId

      public String getAssociatedOrderId()
      Returns the associatedId.
    • setAssociatedOrderId

      public void setAssociatedOrderId(String associatedOrderId)
      Sets the associatedOrderId.
    • getAssociatedOrderItemSeqId

      public String getAssociatedOrderItemSeqId()
      Returns the associatedOrderItemSeqId.
    • setAssociatedOrderItemSeqId

      public void setAssociatedOrderItemSeqId(String associatedOrderItemSeqId)
      Sets the associatedOrderItemSeqId.
    • getStatusId

      public String getStatusId()
      Gets status id.
      Returns:
      the status id
    • setStatusId

      public void setStatusId(String statusId)
      Sets status id.
      Parameters:
      statusId - the status id
    • shippingApplies

      public boolean shippingApplies()
      Returns true if shipping charges apply to this item.
    • taxApplies

      public boolean taxApplies()
      Returns true if tax charges apply to this item.
    • getProductId

      public String getProductId()
      Returns the item's productId.
    • getSupplierProductId

      public String getSupplierProductId()
      Returns the item's supplierProductId.
    • setSupplierProductId

      public void setSupplierProductId(String supplierProductId)
      Set the item's supplierProductId.
    • setLocale

      protected void setLocale(Locale locale)
      Set the item's locale (from ShoppingCart.setLocale)
    • getName

      @Deprecated public String getName()
      Deprecated.
      use getName(LocalDispatcher dispatcher)
      Returns the item's description.
    • setName

      public void setName(String itemName)
      Set the item's description.
    • getName

      public String getName(LocalDispatcher dispatcher)
      Returns the item's description or PRODUCT_NAME from content.
    • getDescription

      public String getDescription(LocalDispatcher dispatcher)
      Returns the item's description.
    • getConfigWrapper

      public ProductConfigWrapper getConfigWrapper()
      Gets config wrapper.
      Returns:
      the config wrapper
    • getWeight

      public BigDecimal getWeight()
      Returns the item's unit weight
    • getPiecesIncluded

      public long getPiecesIncluded()
      Returns the item's pieces included
    • getFeatureSet

      public Set<String> getFeatureSet()
      Returns a Set of the item's features
    • getStandardFeatureList

      public List<GenericValue> getStandardFeatureList()
      Returns a list of the item's standard features
    • getFeaturesForSupplier

      public List<GenericValue> getFeaturesForSupplier(LocalDispatcher dispatcher, String partyId)
      Returns a List of the item's features for supplier
    • getSize

      public BigDecimal getSize()
      Returns the item's size (length + girth)
    • getItemProductInfo

      public Map<String,Object> getItemProductInfo()
      Gets item product info.
      Returns:
      the item product info
    • getBasePrice

      public BigDecimal getBasePrice()
      Returns the base price.
      Returns:
      the base price
    • setBasePrice

      public void setBasePrice(BigDecimal basePrice)
      Sets the base price for the item; use with caution
      Parameters:
      basePrice - the base price
    • getDisplayPrice

      public BigDecimal getDisplayPrice()
      Gets display price.
      Returns:
      the display price
    • setDisplayPrice

      public void setDisplayPrice(BigDecimal displayPrice)
      Sets the display price for the item; use with caution
      Parameters:
      displayPrice - the display price
    • getSpecialPromoPrice

      public BigDecimal getSpecialPromoPrice()
      Gets special promo price.
      Returns:
      the special promo price
    • setSpecialPromoPrice

      public void setSpecialPromoPrice(BigDecimal specialPromoPrice)
      Sets special promo price.
      Parameters:
      specialPromoPrice - the special promo price
    • getRecurringBasePrice

      public BigDecimal getRecurringBasePrice()
      Gets recurring base price.
      Returns:
      the recurring base price
    • setRecurringBasePrice

      public void setRecurringBasePrice(BigDecimal recurringBasePrice)
      Sets the base price for the item; use with caution
    • getRecurringDisplayPrice

      public BigDecimal getRecurringDisplayPrice()
      Gets recurring display price.
      Returns:
      the recurring display price
    • setRecurringDisplayPrice

      public void setRecurringDisplayPrice(BigDecimal recurringDisplayPrice)
      Sets the display price for the item; use with caution
    • getListPrice

      public BigDecimal getListPrice()
      Returns the list price.
    • setListPrice

      public void setListPrice(BigDecimal listPrice)
      Sets list price.
      Parameters:
      listPrice - the list price
    • getIsModifiedPrice

      public boolean getIsModifiedPrice()
      Returns isModifiedPrice
    • setIsModifiedPrice

      public void setIsModifiedPrice(boolean isModifiedPrice)
      Set isModifiedPrice
    • getReserv2ndPPPerc

      public BigDecimal getReserv2ndPPPerc()
      get the percentage for the second person
    • setReserv2ndPPPerc

      public void setReserv2ndPPPerc(BigDecimal reserv2ndPPPerc)
      Sets the extra % for second person
    • getReservNthPPPerc

      public BigDecimal getReservNthPPPerc()
      get the percentage for the third and following person
    • setReservNthPPPerc

      public void setReservNthPPPerc(BigDecimal reservNthPPPerc)
      Sets the extra % for third and following person
    • getOtherAdjustments

      public BigDecimal getOtherAdjustments()
      Returns the "other" adjustments.
    • getOtherAdjustmentsRecurring

      public BigDecimal getOtherAdjustmentsRecurring()
      Returns the "other" adjustments.
    • getRentalAdjustment

      public BigDecimal getRentalAdjustment()
      calculates for a reservation the percentage/100 extra for more than 1 person.
    • getItemSubTotal

      public BigDecimal getItemSubTotal(BigDecimal quantity)
      Returns the total line price.
    • getItemSubTotal

      public BigDecimal getItemSubTotal()
      Gets item sub total.
      Returns:
      the item sub total
    • getDisplayItemSubTotal

      public BigDecimal getDisplayItemSubTotal()
      Gets display item sub total.
      Returns:
      the display item sub total
    • getDisplayItemSubTotalNoAdj

      public BigDecimal getDisplayItemSubTotalNoAdj()
      Gets display item sub total no adj.
      Returns:
      the display item sub total no adj
    • getDisplayItemRecurringSubTotal

      public BigDecimal getDisplayItemRecurringSubTotal()
      Gets display item recurring sub total.
      Returns:
      the display item recurring sub total
    • getDisplayItemRecurringSubTotalNoAdj

      public BigDecimal getDisplayItemRecurringSubTotalNoAdj()
      Gets display item recurring sub total no adj.
      Returns:
      the display item recurring sub total no adj
    • addAllProductFeatureAndAppls

      public void addAllProductFeatureAndAppls(Map<String,GenericValue> productFeatureAndApplsToAdd)
      Add all product feature and appls.
      Parameters:
      productFeatureAndApplsToAdd - the product feature and appls to add
    • putAdditionalProductFeatureAndAppl

      public void putAdditionalProductFeatureAndAppl(GenericValue additionalProductFeatureAndAppl)
      Put additional product feature and appl.
      Parameters:
      additionalProductFeatureAndAppl - the additional product feature and appl
    • getAdditionalProductFeatureAndAppl

      public GenericValue getAdditionalProductFeatureAndAppl(String productFeatureTypeId)
      Gets additional product feature and appl.
      Parameters:
      productFeatureTypeId - the product feature type id
      Returns:
      the additional product feature and appl
    • removeAdditionalProductFeatureAndAppl

      public GenericValue removeAdditionalProductFeatureAndAppl(String productFeatureTypeId)
      Remove additional product feature and appl generic value.
      Parameters:
      productFeatureTypeId - the product feature type id
      Returns:
      the generic value
    • getAdditionalProductFeatureAndAppls

      public Map<String,GenericValue> getAdditionalProductFeatureAndAppls()
      Gets additional product feature and appls.
      Returns:
      the additional product feature and appls
    • getFeatureIdQtyMap

      public Map<String,BigDecimal> getFeatureIdQtyMap(BigDecimal quantity)
      Gets feature id qty map.
      Parameters:
      quantity - the quantity
      Returns:
      the feature id qty map
    • removeAttribute

      public void removeAttribute(String name)
      Removes an item attribute.
    • setAttribute

      public void setAttribute(String name, Object value)
      Sets an item attribute.
    • getAttribute

      public Object getAttribute(String name)
      Return a specific attribute.
    • getAttributes

      public Map<String,Object> getAttributes()
      Returns the attributes for the item.
    • removeOrderItemAttribute

      public void removeOrderItemAttribute(String name)
      Remove an OrderItemAttribute.
    • setOrderItemAttribute

      public void setOrderItemAttribute(String name, String value)
      Creates an OrderItemAttribute entry.
    • getOrderItemAttribute

      public String getOrderItemAttribute(String name)
      Return an OrderItemAttribute.
    • getOrderItemAttributes

      public Map<String,String> getOrderItemAttributes()
      Gets order item attributes.
      Returns:
      the order item attributes
    • addAdjustment

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

      public void removeAdjustment(GenericValue adjustment)
      Remove adjustment.
      Parameters:
      adjustment - the adjustment
    • removeAdjustment

      public void removeAdjustment(int index)
      Remove adjustment.
      Parameters:
      index - the index
    • getAdjustments

      public List<GenericValue> getAdjustments()
      Gets adjustments.
      Returns:
      the adjustments
    • removeFeatureAdjustment

      public void removeFeatureAdjustment(String productFeatureId)
      Remove feature adjustment.
      Parameters:
      productFeatureId - the product feature id
    • getOrderItemPriceInfos

      public List<GenericValue> getOrderItemPriceInfos()
      Gets order item price infos.
      Returns:
      the order item price infos
    • 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 item given the contactMechPurposeTypeId
    • removeContactMech

      public String removeContactMech(String contactMechPurposeTypeId)
      Remove the contactMechId from this item given the contactMechPurposeTypeId
    • getOrderItemContactMechIds

      public Map<String,String> getOrderItemContactMechIds()
      Gets order item contact mech ids.
      Returns:
      the order item contact mech ids
    • getIsPromo

      public boolean getIsPromo()
      Gets is promo.
      Returns:
      the is promo
    • setIsPromo

      public void setIsPromo(boolean isPromo)
      Sets is promo.
      Parameters:
      isPromo - the is promo
    • getAlternativeOptionProductIds

      public List<String> getAlternativeOptionProductIds()
      Gets alternative option product ids.
      Returns:
      the alternative option product ids
    • setAlternativeOptionProductIds

      public void setAlternativeOptionProductIds(List<String> alternativeOptionProductIds)
      Sets alternative option product ids.
      Parameters:
      alternativeOptionProductIds - the alternative option product ids
    • equals

      public boolean equals(ShoppingCartItem item)
      Equals boolean.
      Parameters:
      item - the item
      Returns:
      the boolean
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(String productId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, BigDecimal selectedAmount)
      Compares the specified object with this cart item. Defaults isPromo to false. Default to no itemGroup.
    • equals

      public boolean equals(String productId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, BigDecimal selectedAmount)
      Compares the specified object with this cart item. Defaults isPromo to false.
    • equals

      public boolean equals(String productId, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, BigDecimal selectedAmount)
      Compares the specified object with this cart item including rental data. Defaults isPromo to false.
    • equals

      public boolean equals(String productId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, BigDecimal selectedAmount, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo)
      Compares the specified object with this cart item. Defaults isPromo to false.
    • equals

      public boolean equals(String productId, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, BigDecimal selectedAmount, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo)
      Compares the specified object with this cart item.
    • equals

      public boolean equals(String productId, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, Map<String,String> orderItemAttributes, String prodCatalogId, BigDecimal selectedAmount, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo)
      Compares the specified object order item attributes.
    • getProduct

      public GenericValue getProduct()
      Gets the Product entity. If it is not already retreived gets it from the delegator
    • getParentProduct

      public GenericValue getParentProduct()
      Gets parent product.
      Returns:
      the parent product
    • getParentProductId

      public String getParentProductId()
      Gets parent product id.
      Returns:
      the parent product id
    • getOptionalProductFeatures

      public Map<String,List<GenericValue>> getOptionalProductFeatures()
      Gets optional product features.
      Returns:
      the optional product features
    • getDelegator

      public Delegator getDelegator()
      Gets delegator.
      Returns:
      the delegator
    • explodeItem

      public List<ShoppingCartItem> explodeItem(ShoppingCart cart, LocalDispatcher dispatcher) throws CartItemModifyException
      Explode item list.
      Parameters:
      cart - the cart
      dispatcher - the dispatcher
      Returns:
      the list
      Throws:
      CartItemModifyException - the cart item modify exception