public class ShoppingCartItem extends Object implements Serializable
Title: ShoppingCartItem.java
Description: Shopping cart item object.
Modifier and Type | Field and Description |
---|---|
protected static String[] |
attributeNames |
static MathContext |
generalRounding |
static String |
module |
static String |
resource |
static String |
resource_error |
Modifier | Constructor and Description |
---|---|
protected |
ShoppingCartItem()
Cannot create shopping cart item with no parameters
|
protected |
ShoppingCartItem(Delegator delegator,
String itemTypeId,
String description,
String categoryId,
BigDecimal basePrice,
Map<String,Object> attributes,
String prodCatalogId,
Locale locale,
ShoppingCart.ShoppingCartItemGroup itemGroup)
Creates new ShopingCartItem object.
|
protected |
ShoppingCartItem(GenericValue product,
Map<String,GenericValue> additionalProductFeatureAndAppls,
Map<String,Object> attributes,
String prodCatalogId,
Locale locale,
String itemType,
ShoppingCart.ShoppingCartItemGroup itemGroup)
Deprecated.
Use
#ShoppingCartItem(GenericValue, Map, Map, String, Locale, String, ShoppingCartItemGroup, LocalDispatcher) instead |
protected |
ShoppingCartItem(GenericValue product,
Map<String,GenericValue> additionalProductFeatureAndAppls,
Map<String,Object> attributes,
String prodCatalogId,
Locale locale,
String itemType,
ShoppingCart.ShoppingCartItemGroup itemGroup,
LocalDispatcher dispatcher)
Creates new ShoppingCartItem object.
|
protected |
ShoppingCartItem(GenericValue product,
Map<String,GenericValue> additionalProductFeatureAndAppls,
Map<String,Object> attributes,
String prodCatalogId,
ProductConfigWrapper configWrapper,
Locale locale,
String itemType,
ShoppingCart.ShoppingCartItemGroup itemGroup,
GenericValue parentProduct)
Creates new ShoppingCartItem object.
|
|
ShoppingCartItem(ShoppingCartItem item)
Clone an item.
|
Modifier and Type | Method and Description |
---|---|
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
|
void |
addAllProductFeatureAndAppls(Map<String,GenericValue> productFeatureAndApplsToAdd) |
void |
addContactMech(String contactMechPurposeTypeId,
String contactMechId)
Add a contact mech to this purpose; the contactMechPurposeTypeId is required
|
BigDecimal |
addPromoQuantityCandidateUse(BigDecimal quantityDesired,
GenericValue productPromoCondAction,
boolean checkAvailableOnly) |
void |
calcDepositAdjustments() |
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
|
void |
clearPromoRuleUseInfo() |
void |
confirmPromoRuleUse(String productPromoId,
String productPromoRuleId) |
boolean |
equals(Object obj) |
boolean |
equals(ShoppingCartItem item) |
boolean |
equals(String productId,
Map<String,GenericValue> additionalProductFeatureAndAppls,
Map<String,Object> attributes,
String prodCatalogId,
BigDecimal selectedAmount)
Compares the specified object with this cart item.
|
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.
|
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.
|
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.
|
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.
|
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.
|
List<ShoppingCartItem> |
explodeItem(ShoppingCart cart,
LocalDispatcher dispatcher) |
static GenericValue |
findProduct(Delegator delegator,
boolean skipProductChecks,
String prodCatalogId,
String productId,
Locale locale) |
String |
getAccommodationMapId()
Returns accommodationMapId
|
String |
getAccommodationSpotId()
Returns accommodationSpotId
|
GenericValue |
getAdditionalProductFeatureAndAppl(String productFeatureTypeId) |
Map<String,GenericValue> |
getAdditionalProductFeatureAndAppls() |
List<GenericValue> |
getAdjustments() |
List<String> |
getAlternativeOptionProductIds() |
String |
getAssociatedOrderId()
Returns the associatedId.
|
String |
getAssociatedOrderItemSeqId()
Returns the associatedOrderItemSeqId.
|
Object |
getAttribute(String name)
Return a specific attribute.
|
Map<String,Object> |
getAttributes()
Returns the attributes for the item.
|
BigDecimal |
getBasePrice()
Returns the base price.
|
Timestamp |
getCancelBackOrderDate()
Returns the cancel back order date
|
ProductConfigWrapper |
getConfigWrapper() |
String |
getContactMech(String contactMechPurposeTypeId)
Get the contactMechId for this item given the contactMechPurposeTypeId
|
Delegator |
getDelegator() |
String |
getDescription(LocalDispatcher dispatcher)
Returns the item's description.
|
Timestamp |
getDesiredDeliveryDate()
Returns the item's customer desired delivery date.
|
BigDecimal |
getDisplayItemRecurringSubTotal() |
BigDecimal |
getDisplayItemRecurringSubTotalNoAdj() |
BigDecimal |
getDisplayItemSubTotal() |
BigDecimal |
getDisplayItemSubTotalNoAdj() |
BigDecimal |
getDisplayPrice() |
Timestamp |
getEstimatedShipDate()
Returns the date to EstimatedShipDate
|
String |
getExternalId() |
Map<String,BigDecimal> |
getFeatureIdQtyMap(BigDecimal quantity) |
Set<String> |
getFeatureSet()
Returns a Set of the item's features
|
List<GenericValue> |
getFeaturesForSupplier(LocalDispatcher dispatcher,
String partyId)
Returns a List of the item's features for supplier
|
boolean |
getIsModifiedPrice()
Returns isModifiedPrice
|
boolean |
getIsPromo() |
String |
getItemComment()
Returns the item's comment.
|
ShoppingCart.ShoppingCartItemGroup |
getItemGroup()
Returns the item group.
|
Map<String,Object> |
getItemProductInfo() |
BigDecimal |
getItemSubTotal() |
BigDecimal |
getItemSubTotal(BigDecimal quantity)
Returns the total line price.
|
String |
getItemType()
Returns the item type.
|
String |
getItemTypeDescription()
Returns the item type description.
|
GenericValue |
getItemTypeGenericValue()
Returns the item type.
|
BigDecimal |
getListPrice()
Returns the list price.
|
String |
getName()
Deprecated.
use getName(LocalDispatcher dispatcher)
|
String |
getName(LocalDispatcher dispatcher)
Returns the item's description or PRODUCT_NAME from content.
|
Map<String,List<GenericValue>> |
getOptionalProductFeatures() |
String |
getOrderItemAssocTypeId()
Returns the OrderItemAssocTypeId.
|
String |
getOrderItemAttribute(String name)
Return an OrderItemAttribute.
|
Map<String,String> |
getOrderItemAttributes() |
Map<String,String> |
getOrderItemContactMechIds() |
List<GenericValue> |
getOrderItemPriceInfos() |
String |
getOrderItemSeqId() |
BigDecimal |
getOtherAdjustments()
Returns the "other" adjustments.
|
BigDecimal |
getOtherAdjustmentsRecurring()
Returns the "other" adjustments.
|
GenericValue |
getParentProduct() |
String |
getParentProductId() |
long |
getPiecesIncluded()
Returns the item's pieces included
|
String |
getProdCatalogId() |
GenericValue |
getProduct()
Gets the Product entity.
|
String |
getProductCategoryId()
Returns the productCategoryId for the item or null if none.
|
String |
getProductId()
Returns the item's productId.
|
BigDecimal |
getPromoQuantityAvailable() |
BigDecimal |
getPromoQuantityCandidateUse(GenericValue productPromoCondAction) |
BigDecimal |
getPromoQuantityCandidateUseActionAndAllConds(GenericValue productPromoAction) |
BigDecimal |
getPromoQuantityUsed() |
static String |
getPurchaseOrderItemDescription(GenericValue product,
GenericValue supplierProduct,
Locale locale,
LocalDispatcher dispatcher) |
BigDecimal |
getQuantity()
Returns the quantity.
|
Iterator<Map.Entry<GenericPK,BigDecimal>> |
getQuantityUsedPerPromoActualIter() |
Iterator<Map.Entry<GenericPK,BigDecimal>> |
getQuantityUsedPerPromoCandidateIter() |
Iterator<Map.Entry<GenericPK,BigDecimal>> |
getQuantityUsedPerPromoFailedIter() |
String |
getQuoteId()
Returns the quoteId.
|
String |
getQuoteItemSeqId()
Returns the quoteItemSeqId.
|
BigDecimal |
getRecurringBasePrice() |
BigDecimal |
getRecurringDisplayPrice() |
BigDecimal |
getRentalAdjustment()
calculates for a reservation the percentage/100 extra for more than 1 person.
|
String |
getRequirementId()
Returns the requirementId.
|
BigDecimal |
getReserv2ndPPPerc()
get the percentage for the second person
|
Timestamp |
getReserveAfterDate()
Returns the date to ship after
|
BigDecimal |
getReservLength()
Returns the reservation length.
|
BigDecimal |
getReservNthPPPerc()
get the percentage for the third and following person
|
BigDecimal |
getReservPersons()
Returns the reservation number of persons.
|
Timestamp |
getReservStart()
Returns the reservation start date.
|
Timestamp |
getReservStart(BigDecimal addDays)
Returns the reservation start date with a number of days added.
|
BigDecimal |
getSelectedAmount()
Returns the user selected amount
|
Timestamp |
getShipAfterDate()
Returns the date to ship after
|
Timestamp |
getShipBeforeDate()
Returns the date to ship before
|
String |
getShoppingListId() |
String |
getShoppingListItemSeqId() |
BigDecimal |
getSize()
Returns the item's size (length + girth)
|
BigDecimal |
getSpecialPromoPrice() |
List<GenericValue> |
getStandardFeatureList()
Returns a list of the item's standard features
|
String |
getStatusId() |
String |
getSupplierProductId()
Returns the item's supplierProductId.
|
BigDecimal |
getWeight()
Returns the item's unit weight
|
int |
hashCode() |
boolean |
isInItemGroup(String groupNumber) |
protected boolean |
isInventoryAvailableOrNotRequired(BigDecimal quantity,
String productStoreId,
LocalDispatcher dispatcher) |
static void |
isValidCartProduct(ProductConfigWrapper configWrapper,
GenericValue product,
Timestamp nowTimestamp,
Locale locale) |
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)
Makes a ShoppingCartItem and adds it to the cart.
|
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)
Makes a ShoppingCartItem and adds it to the cart.
|
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) |
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)
Makes a ShoppingCartItem and adds it to the cart.
|
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)
Makes a ShoppingCartItem and adds it to the cart.
|
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)
Makes a non-product ShoppingCartItem and adds it to the cart.
|
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)
Makes a ShoppingCartItem for a purchase order item and adds it to the cart.
|
void |
putAdditionalProductFeatureAndAppl(GenericValue additionalProductFeatureAndAppl) |
GenericValue |
removeAdditionalProductFeatureAndAppl(String productFeatureTypeId) |
void |
removeAdjustment(GenericValue adjustment) |
void |
removeAdjustment(int index) |
void |
removeAttribute(String name)
Removes an item attribute.
|
String |
removeContactMech(String contactMechPurposeTypeId)
Remove the contactMechId from this item given the contactMechPurposeTypeId
|
void |
removeFeatureAdjustment(String productFeatureId) |
void |
removeOrderItemAttribute(String name)
Remove an OrderItemAttribute.
|
void |
resetPromoRuleUse(String productPromoId,
String productPromoRuleId) |
void |
setAccommodationId(String accommodationMapId,
String accommodationSpotId)
Sets accommodationId using the reservation
|
void |
setAlternativeOptionProductIds(List<String> alternativeOptionProductIds) |
void |
setAssociatedOrderId(String associatedOrderId)
Sets the associatedOrderId.
|
void |
setAssociatedOrderItemSeqId(String associatedOrderItemSeqId)
Sets the associatedOrderItemSeqId.
|
void |
setAttribute(String name,
Object value)
Sets an item attribute.
|
void |
setBasePrice(BigDecimal basePrice)
Sets the base price for the item; use with caution
|
void |
setCancelBackOrderDate(Timestamp date)
Sets the cancel back order date
|
void |
setDesiredDeliveryDate(Timestamp ddDate)
Sets the item's customer desired delivery date.
|
void |
setDisplayPrice(BigDecimal displayPrice)
Sets the display price for the item; use with caution
|
void |
setEstimatedShipDate(Timestamp date)
Sets the date to EstimatedShipDate
|
void |
setExternalId(String externalId) |
void |
setIsModifiedPrice(boolean isModifiedPrice)
Set isModifiedPrice
|
void |
setIsPromo(boolean isPromo) |
void |
setItemComment(String itemComment)
Sets the item comment.
|
void |
setItemGroup(ShoppingCart.ShoppingCartItemGroup itemGroup)
Sets the item group.
|
void |
setItemGroup(String groupNumber,
ShoppingCart cart)
Sets the item group.
|
void |
setItemType(String itemType)
Sets the item type.
|
void |
setListPrice(BigDecimal listPrice) |
protected void |
setLocale(Locale locale)
Set the item's locale (from ShoppingCart.setLocale)
|
void |
setName(String itemName)
Set the item's description.
|
void |
setOrderItemAssocTypeId(String orderItemAssocTypeId)
Sets the orderItemAssocTypeId.
|
void |
setOrderItemAttribute(String name,
String value)
Creates an OrderItemAttribute entry.
|
void |
setOrderItemSeqId(String orderItemSeqId) |
void |
setProductCategoryId(String productCategoryId) |
void |
setQuantity(BigDecimal quantity,
LocalDispatcher dispatcher,
ShoppingCart cart)
Sets the quantity for the item and validates the change in quantity, etc
|
void |
setQuantity(BigDecimal quantity,
LocalDispatcher dispatcher,
ShoppingCart cart,
boolean triggerExternalOps)
Sets the quantity for the item and validates the change in quantity, etc
|
void |
setQuantity(BigDecimal quantity,
LocalDispatcher dispatcher,
ShoppingCart cart,
boolean triggerExternalOps,
boolean resetShipGroup)
Sets the quantity for the item and validates the change in quantity, etc
|
void |
setQuantity(BigDecimal quantity,
LocalDispatcher dispatcher,
ShoppingCart cart,
boolean triggerExternalOps,
boolean resetShipGroup,
boolean updateProductPrice)
Sets the quantity for the item and validates the change in quantity, etc
|
protected void |
setQuantity(BigDecimal quantity,
LocalDispatcher dispatcher,
ShoppingCart cart,
boolean triggerExternalOps,
boolean resetShipGroup,
boolean updateProductPrice,
boolean skipInventoryChecks) |
void |
setQuoteId(String quoteId)
Sets the quoteId.
|
void |
setQuoteItemSeqId(String quoteItemSeqId)
Sets the quoteItemSeqId.
|
void |
setRecurringBasePrice(BigDecimal recurringBasePrice)
Sets the base price for the item; use with caution
|
void |
setRecurringDisplayPrice(BigDecimal recurringDisplayPrice)
Sets the display price for the item; use with caution
|
void |
setRequirementId(String requirementId)
Sets the requirementId.
|
void |
setReserv2ndPPPerc(BigDecimal reserv2ndPPPerc)
Sets the extra % for second person
|
void |
setReserveAfterDate(Timestamp date)
Sets the date to ship after
|
void |
setReservLength(BigDecimal reservLength)
Sets the reservation length
|
void |
setReservNthPPPerc(BigDecimal reservNthPPPerc)
Sets the extra % for third and following person
|
void |
setReservPersons(BigDecimal reservPersons)
Sets number of persons using the reservation
|
void |
setReservStart(Timestamp reservStart)
Sets the reservation start date
|
void |
setSelectedAmount(BigDecimal selectedAmount)
Sets the user selected amount
|
void |
setShipAfterDate(Timestamp date)
Sets the date to ship after
|
void |
setShipBeforeDate(Timestamp date)
Sets the date to ship before
|
void |
setShoppingList(String shoppingListId,
String itemSeqId) |
void |
setSpecialPromoPrice(BigDecimal specialPromoPrice) |
void |
setStatusId(String statusId) |
void |
setSupplierProductId(String supplierProductId)
Set the item's supplierProductId.
|
boolean |
shippingApplies()
Returns true if shipping charges apply to this item.
|
boolean |
taxApplies()
Returns true if tax charges apply to this item.
|
void |
updatePrice(LocalDispatcher dispatcher,
ShoppingCart cart) |
public static final String module
public static final String resource
public static final String resource_error
protected static final String[] attributeNames
public static final MathContext generalRounding
public ShoppingCartItem(ShoppingCartItem item)
protected ShoppingCartItem()
@Deprecated protected ShoppingCartItem(GenericValue product, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, Locale locale, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup)
#ShoppingCartItem(GenericValue, Map, Map, String, Locale, String, ShoppingCartItemGroup, LocalDispatcher)
insteadprotected ShoppingCartItem(GenericValue product, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, Locale locale, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher)
dispatcher
- TODOprotected ShoppingCartItem(GenericValue product, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, Locale locale, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, GenericValue parentProduct)
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
cartLocation
- The location to place this item; null will place at the endproductId
- The primary key of the product being addedquantity
- The quantity to addadditionalProductFeatureAndAppls
- Product feature/appls mapattributes
- All unique attributes for this item (NOT features)prodCatalogId
- The catalog this item was added fromconfigWrapper
- The product configuration wrapper (null if the product is not configurable)dispatcher
- LocalDispatcher object for doing promotions, etccart
- The parent shopping cart object this item will belong tosupplierProduct
- GenericValue of SupplierProduct entity, containing product description and pricesshipBeforeDate
- Request that the shipment be made before this dateshipAfterDate
- Request that the shipment be made after this datecancelBackOrderDate
- The date which if crossed causes order cancellationCartItemModifyException
ItemNotFoundException
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
cartLocation
- The location to place this item; null will place at the endproductId
- The primary key of the product being addedselectedAmount
- 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?CartItemModifyException
ItemNotFoundException
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
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
accommodationMapId
- Optional. reservations add into workeffortaccommodationSpotId
- Optional. reservations add into workeffortCartItemModifyException
ItemNotFoundException
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
cartLocation
- The location to place this item; null will place at the endproduct
- The product entity relating to the product being addedselectedAmount
- 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?CartItemModifyException
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
accommodationMapId
- Optional. reservations add into workeffortaccommodationSpotId
- Optional. reservations add into workeffortCartItemModifyException
public static GenericValue findProduct(Delegator delegator, boolean skipProductChecks, String prodCatalogId, String productId, Locale locale) throws ItemNotFoundException
ItemNotFoundException
public static void isValidCartProduct(ProductConfigWrapper configWrapper, GenericValue product, Timestamp nowTimestamp, Locale locale) throws CartItemModifyException
CartItemModifyException
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
cartLocation
- The location to place this item; null will place at the enditemType
- The OrderItemTypeId for the item being addeditemDescription
- The optional description of the itemproductCategoryId
- The optional category the product *will* go inbasePrice
- The price for this itemselectedAmount
- quantity
- The quantity to addattributes
- All unique attributes for this item (NOT features)prodCatalogId
- The catalog this item was added fromdispatcher
- LocalDispatcher object for doing promotions, etccart
- The parent shopping cart object this item will belong totriggerExternalOpsBool
- Indicates if we should run external operations (promotions, auto-save, etc)CartItemModifyException
public String getProdCatalogId()
public void setExternalId(String externalId)
public String getExternalId()
public void setSelectedAmount(BigDecimal selectedAmount)
public BigDecimal getSelectedAmount()
public void setBasePrice(BigDecimal basePrice)
public void setDisplayPrice(BigDecimal displayPrice)
public void setRecurringBasePrice(BigDecimal recurringBasePrice)
public void setRecurringDisplayPrice(BigDecimal recurringDisplayPrice)
public void setSpecialPromoPrice(BigDecimal specialPromoPrice)
public void setReserv2ndPPPerc(BigDecimal reserv2ndPPPerc)
public void setReservNthPPPerc(BigDecimal reservNthPPPerc)
public void setReservStart(Timestamp reservStart)
public void setReservLength(BigDecimal reservLength)
public void setReservPersons(BigDecimal reservPersons)
public void setAccommodationId(String accommodationMapId, String accommodationSpotId)
public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart) throws CartItemModifyException
CartItemModifyException
public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps) throws CartItemModifyException
CartItemModifyException
public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup) throws CartItemModifyException
CartItemModifyException
public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup, boolean updateProductPrice) throws CartItemModifyException
CartItemModifyException
public static String checkAvailability(String productId, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, ShoppingCart cart)
protected boolean isInventoryAvailableOrNotRequired(BigDecimal quantity, String productStoreId, LocalDispatcher dispatcher) throws CartItemModifyException
CartItemModifyException
protected void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup, boolean updateProductPrice, boolean skipInventoryChecks) throws CartItemModifyException
CartItemModifyException
public void calcDepositAdjustments()
public void updatePrice(LocalDispatcher dispatcher, ShoppingCart cart) throws CartItemModifyException
CartItemModifyException
public BigDecimal getQuantity()
public Timestamp getReservStart()
public Timestamp getReservStart(BigDecimal addDays)
public BigDecimal getReservLength()
public BigDecimal getReservPersons()
public String getAccommodationMapId()
public String getAccommodationSpotId()
public BigDecimal getPromoQuantityUsed()
public BigDecimal getPromoQuantityAvailable()
public Iterator<Map.Entry<GenericPK,BigDecimal>> getQuantityUsedPerPromoActualIter()
public Iterator<Map.Entry<GenericPK,BigDecimal>> getQuantityUsedPerPromoCandidateIter()
public Iterator<Map.Entry<GenericPK,BigDecimal>> getQuantityUsedPerPromoFailedIter()
public BigDecimal addPromoQuantityCandidateUse(BigDecimal quantityDesired, GenericValue productPromoCondAction, boolean checkAvailableOnly)
public BigDecimal getPromoQuantityCandidateUse(GenericValue productPromoCondAction)
public BigDecimal getPromoQuantityCandidateUseActionAndAllConds(GenericValue productPromoAction)
public void confirmPromoRuleUse(String productPromoId, String productPromoRuleId)
public void clearPromoRuleUseInfo()
public void setItemComment(String itemComment)
public String getItemComment()
public void setDesiredDeliveryDate(Timestamp ddDate)
public Timestamp getDesiredDeliveryDate()
public void setShipBeforeDate(Timestamp date)
public Timestamp getShipBeforeDate()
public void setShipAfterDate(Timestamp date)
public Timestamp getShipAfterDate()
public void setReserveAfterDate(Timestamp date)
public Timestamp getReserveAfterDate()
public void setCancelBackOrderDate(Timestamp date)
public Timestamp getCancelBackOrderDate()
public void setEstimatedShipDate(Timestamp date)
public Timestamp getEstimatedShipDate()
public void setItemType(String itemType)
public String getItemType()
public GenericValue getItemTypeGenericValue()
public void setItemGroup(ShoppingCart.ShoppingCartItemGroup itemGroup)
public void setItemGroup(String groupNumber, ShoppingCart cart)
public ShoppingCart.ShoppingCartItemGroup getItemGroup()
public boolean isInItemGroup(String groupNumber)
public String getItemTypeDescription()
public String getProductCategoryId()
public void setProductCategoryId(String productCategoryId)
public void setOrderItemSeqId(String orderItemSeqId)
public String getOrderItemSeqId()
public String getShoppingListId()
public String getShoppingListItemSeqId()
public void setRequirementId(String requirementId)
public String getRequirementId()
public void setQuoteId(String quoteId)
public String getQuoteId()
public void setQuoteItemSeqId(String quoteItemSeqId)
public String getQuoteItemSeqId()
public void setOrderItemAssocTypeId(String orderItemAssocTypeId)
public String getOrderItemAssocTypeId()
public void setAssociatedOrderId(String associatedOrderId)
public String getAssociatedOrderId()
public void setAssociatedOrderItemSeqId(String associatedOrderItemSeqId)
public String getAssociatedOrderItemSeqId()
public String getStatusId()
public void setStatusId(String statusId)
public boolean shippingApplies()
public boolean taxApplies()
public String getProductId()
public String getSupplierProductId()
public void setSupplierProductId(String supplierProductId)
protected void setLocale(Locale locale)
public void setName(String itemName)
@Deprecated public String getName()
public String getName(LocalDispatcher dispatcher)
public String getDescription(LocalDispatcher dispatcher)
public ProductConfigWrapper getConfigWrapper()
public BigDecimal getWeight()
public long getPiecesIncluded()
public List<GenericValue> getStandardFeatureList()
public List<GenericValue> getFeaturesForSupplier(LocalDispatcher dispatcher, String partyId)
public BigDecimal getSize()
public BigDecimal getBasePrice()
public BigDecimal getDisplayPrice()
public BigDecimal getSpecialPromoPrice()
public BigDecimal getRecurringBasePrice()
public BigDecimal getRecurringDisplayPrice()
public BigDecimal getListPrice()
public void setListPrice(BigDecimal listPrice)
public boolean getIsModifiedPrice()
public void setIsModifiedPrice(boolean isModifiedPrice)
public BigDecimal getReserv2ndPPPerc()
public BigDecimal getReservNthPPPerc()
public BigDecimal getOtherAdjustments()
public BigDecimal getOtherAdjustmentsRecurring()
public BigDecimal getRentalAdjustment()
public BigDecimal getItemSubTotal(BigDecimal quantity)
public BigDecimal getItemSubTotal()
public BigDecimal getDisplayItemSubTotal()
public BigDecimal getDisplayItemSubTotalNoAdj()
public BigDecimal getDisplayItemRecurringSubTotal()
public BigDecimal getDisplayItemRecurringSubTotalNoAdj()
public void addAllProductFeatureAndAppls(Map<String,GenericValue> productFeatureAndApplsToAdd)
public void putAdditionalProductFeatureAndAppl(GenericValue additionalProductFeatureAndAppl)
public GenericValue getAdditionalProductFeatureAndAppl(String productFeatureTypeId)
public GenericValue removeAdditionalProductFeatureAndAppl(String productFeatureTypeId)
public Map<String,GenericValue> getAdditionalProductFeatureAndAppls()
public Map<String,BigDecimal> getFeatureIdQtyMap(BigDecimal quantity)
public void removeAttribute(String name)
public void removeOrderItemAttribute(String name)
public void setOrderItemAttribute(String name, String value)
public String getOrderItemAttribute(String name)
public int addAdjustment(GenericValue adjustment)
public void removeAdjustment(GenericValue adjustment)
public void removeAdjustment(int index)
public List<GenericValue> getAdjustments()
public void removeFeatureAdjustment(String productFeatureId)
public List<GenericValue> getOrderItemPriceInfos()
public void addContactMech(String contactMechPurposeTypeId, String contactMechId)
public String getContactMech(String contactMechPurposeTypeId)
public String removeContactMech(String contactMechPurposeTypeId)
public void setIsPromo(boolean isPromo)
public boolean getIsPromo()
public void setAlternativeOptionProductIds(List<String> alternativeOptionProductIds)
public boolean equals(ShoppingCartItem item)
public boolean equals(String productId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, BigDecimal selectedAmount)
public boolean equals(String productId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, BigDecimal selectedAmount)
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)
public boolean equals(String productId, Map<String,GenericValue> additionalProductFeatureAndAppls, Map<String,Object> attributes, String prodCatalogId, BigDecimal selectedAmount, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo)
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)
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)
public GenericValue getProduct()
public GenericValue getParentProduct()
public String getParentProductId()
public Map<String,List<GenericValue>> getOptionalProductFeatures()
public Delegator getDelegator()
public List<ShoppingCartItem> explodeItem(ShoppingCart cart, LocalDispatcher dispatcher) throws CartItemModifyException
CartItemModifyException
public static String getPurchaseOrderItemDescription(GenericValue product, GenericValue supplierProduct, Locale locale, LocalDispatcher dispatcher)