public class ShoppingCart extends Object implements Iterable<ShoppingCartItem>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ShoppingCart.CartPaymentInfo |
static class |
ShoppingCart.CartShipInfo |
static class |
ShoppingCart.ProductPromoUseInfo |
static class |
ShoppingCart.ShoppingCartItemGroup |
Modifier | Constructor and Description |
---|---|
protected |
ShoppingCart()
don't allow empty constructor
|
|
ShoppingCart(Delegator delegator,
String productStoreId,
Locale locale,
String currencyUom)
Creates a new empty ShoppingCart object.
|
|
ShoppingCart(Delegator delegator,
String productStoreId,
String webSiteId,
Locale locale,
String currencyUom)
Creates new empty ShoppingCart object.
|
|
ShoppingCart(Delegator delegator,
String productStoreId,
String webSiteId,
Locale locale,
String currencyUom,
String billToCustomerPartyId,
String billFromVendorPartyId)
Creates new empty ShoppingCart object.
|
|
ShoppingCart(ShoppingCart cart)
Creates a new cloned ShoppingCart Object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalPartyRole(String partyId,
String roleTypeId)
Associates a party with a role to the order.
|
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
|
void |
addContactMech(String contactMechPurposeTypeId,
String contactMechId)
Add a contact mech to this purpose; the contactMechPurposeTypeId is required
|
void |
addFreeShippingProductPromoAction(GenericValue productPromoAction)
Adds a ProductPromoAction to be used for free shipping (must be of type free shipping, or nothing will be done).
|
void |
addInternalOrderNote(String note) |
int |
addItem(int index,
ShoppingCartItem item)
Add an item to the shopping cart.
|
ShoppingCart.ShoppingCartItemGroup |
addItemGroup(GenericValue itemGroupValue) |
String |
addItemGroup(String groupName,
String parentGroupNumber)
Creates a new Item Group and returns the groupNumber that represents it
|
int |
addItemToEnd(ShoppingCartItem item)
Add an item to the shopping cart.
|
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)
Add an item to the shopping cart.
|
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)
Add an item to the shopping cart.
|
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)
Add an item to the shopping cart.
|
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)
Add an (rental/aggregated)item to the shopping cart.
|
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)
Add an (rental)item to the shopping cart.
|
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)
Add an (rental)item to the shopping cart.
|
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)
Add an accommodation(rental/aggregated)item to the shopping cart.
|
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)
Add an accommodation(rental)item to the shopping cart.
|
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)
Add an accommodation(rental)item to the shopping cart.
|
int |
addNonProductItem(String itemType,
String description,
String categoryId,
BigDecimal price,
BigDecimal quantity,
Map<String,Object> attributes,
String prodCatalogId,
String itemGroupNumber,
LocalDispatcher dispatcher)
Add a non-product item to the shopping cart.
|
void |
addOrderNote(String note) |
int |
addOrderTerm(GenericValue orderTerm)
Add an orderTerm to the order
|
int |
addOrderTerm(String termTypeId,
BigDecimal termValue,
Long termDays)
Add an orderTerm to the order
|
int |
addOrderTerm(String termTypeId,
BigDecimal termValue,
Long termDays,
String textValue)
Add an orderTerm to the order
|
int |
addOrderTerm(String termTypeId,
String orderItemSeqId,
BigDecimal termValue,
Long termDays,
String textValue,
String description) |
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)
add rental (with accommodation) item to cart and order item attributes
|
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)
add rental (with accommodation) item to cart
|
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)
add rental (with accommodation) item to cart and order item attributes
|
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)
Add an item to the shopping cart, or if already there, increase the quantity.
|
ShoppingCart.CartPaymentInfo |
addPayment(String id)
adds a payment method/payment method type
|
ShoppingCart.CartPaymentInfo |
addPaymentAmount(String id,
BigDecimal amount)
adds a payment method/payment method type
|
ShoppingCart.CartPaymentInfo |
addPaymentAmount(String id,
BigDecimal amount,
boolean isSingleUse)
adds a payment method/payment method type
|
ShoppingCart.CartPaymentInfo |
addPaymentAmount(String id,
BigDecimal amount,
String refNum,
String authCode,
boolean isSingleUse,
boolean isPresent,
boolean replace)
adds a payment method/payment method type
|
void |
addPaymentRef(String id,
String ref,
String authCode) |
String |
addProductPromoCode(String productPromoCodeId,
LocalDispatcher dispatcher)
Adds a promotion code to the cart, checking if it is valid.
|
void |
addProductPromoUse(String productPromoId,
String productPromoCodeId,
BigDecimal totalDiscountAmount,
BigDecimal quantityLeftInActions,
Map<ShoppingCartItem,BigDecimal> usageInfoMap) |
int |
addShipInfo() |
protected boolean |
checkShipItemInfo(ShoppingCart.CartShipInfo csi,
ShoppingCart.CartShipInfo.CartShipItemInfo csii) |
void |
cleanUpShipGroups() |
void |
clear()
Clears out the cart.
|
void |
clearAllAdjustments() |
void |
clearAllItemStatus() |
void |
clearAllPromotionAdjustments() |
void |
clearAllPromotionInformation() |
void |
clearCartItemUseInPromoInfo() |
void |
clearDeclinedPaymentMethods(Delegator delegator)
remove declined payment methods for an order from cart.
|
void |
clearInternalOrderNotes() |
void |
clearItemShipInfo(ShoppingCartItem item) |
void |
clearOrderNotes() |
void |
clearPayment(int index)
removes a specific payment info from the list
|
void |
clearPayment(String id)
removes a specific payment method/payment method type
|
void |
clearPaymentMethodsById(List<String> paymentMethodIdsToRemove)
remove all the paymentMethods based on the paymentMethodIds
|
void |
clearPayments()
clears all payment method/payment method types
|
void |
clearProductPromoUseInfo() |
void |
confirmPromoRuleUse(String productPromoId,
String productPromoRuleId) |
boolean |
containAllWorkEffortCartItems() |
boolean |
containAnyWorkEffortCartItems() |
boolean |
containOnlyDigitalGoods()
Check to see if the cart contains only Digital Goods, ie no Finished Goods and no Finished/Digital Goods, et cetera.
|
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.
|
void |
createDropShipGroups(LocalDispatcher dispatcher)
Examine each item of each ship group and create new ship groups if the item should be drop shipped
|
void |
deleteItemGroup(String groupNumber) |
void |
ensureItemsQuantity(List<ShoppingCartItem> cartItems,
LocalDispatcher dispatcher,
BigDecimal quantity) |
BigDecimal |
ensureItemsTotalQuantity(List<ShoppingCartItem> cartItems,
LocalDispatcher dispatcher,
BigDecimal quantity) |
void |
explodeItems(List<ShoppingCartItem> shoppingCartItems,
LocalDispatcher dispatcher)
Does an "explode", or "unitize" operation on a list of cart items.
|
List<ShoppingCartItem> |
findAllCartItems(String productId)
Get all ShoppingCartItems from the cart object with the given productId.
|
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
|
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
|
ShoppingCartItem |
findCartItem(int index)
Get a ShoppingCartItem from the cart object.
|
ShoppingCartItem |
findCartItem(String orderItemSeqId) |
ShoppingCartItem |
findCartItem(String productId,
Map<String,GenericValue> features,
Map<String,Object> attributes,
String prodCatalogId,
BigDecimal selectedAmount)
Get a ShoppingCartItem from the cart object.
|
Map<String,List<String>> |
getAdditionalPartyRoleMap() |
GenericValue |
getAdjustment(int index) |
int |
getAdjustmentPromoIndex(String productPromoId) |
List<GenericValue> |
getAdjustments()
Get a List of adjustments on the order (ie cart)
|
String |
getAggregatedInstanceId(ShoppingCartItem item,
LocalDispatcher dispatcher)
Returns the Id of an AGGREGATED_CONF product having exact configId.
|
String |
getAgreementId() |
Map<GenericPK,String> |
getAllDesiredAlternateGiftByActionCopy() |
<T> T |
getAttribute(String name) |
String |
getAutoOrderShoppingListId() |
String |
getAutoSaveListId() |
GenericValue |
getAutoUserLogin() |
String |
getBillFromVendorPartyId() |
BigDecimal |
getBillingAccountAmount()
Returns the amount to be billed to the billing account.
|
String |
getBillingAccountId()
Returns the billing message string.
|
BigDecimal |
getBillingAccountPaymentPreferenceTotal() |
GenericValue |
getBillingAddress() |
String |
getBillToCustomerPartyId() |
Timestamp |
getCancelBackOrderDate() |
String |
getCarrierPartyId() |
String |
getCarrierPartyId(int idx) |
Timestamp |
getCartCreatedTime() |
List<ShoppingCartItem> |
getCartItemsInGroup(String groupNumber) |
List<ShoppingCartItem> |
getCartItemsInNoGroup() |
String |
getChannelType() |
String |
getContactMech(String contactMechPurposeTypeId)
Get the contactMechId for this cart given the contactMechPurposeTypeId
|
BigDecimal |
getCreditCardPaymentPreferenceTotal() |
List<GenericValue> |
getCreditCards() |
String |
getCurrency()
Get the current currency setting.
|
String |
getDefaultItemComment() |
String |
getDefaultItemDeliveryDate() |
Timestamp |
getDefaultReserveAfterDate() |
Timestamp |
getDefaultShipAfterDate() |
Timestamp |
getDefaultShipBeforeDate() |
Delegator |
getDelegator() |
String |
getDesiredAlternateGiftByAction(GenericPK productPromoActionPK) |
BigDecimal |
getDisplayGrandTotal()
Returns the total from the cart, including tax/shipping.
|
BigDecimal |
getDisplayRecurringSubTotal() |
BigDecimal |
getDisplaySubTotal() |
BigDecimal |
getDisplayTaxIncluded() |
boolean |
getDoPromotions() |
String |
getEndUserCustomerPartyId() |
String |
getExternalId() |
String |
getFacilityId() |
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.
|
String |
getFirstAttemptOrderId()
Returns the first attempt order ID associated with this cart or null if no order has been created yet.
|
List<GenericValue> |
getFreeShippingProductPromoActions() |
BigDecimal |
getGiftCardPaymentPreferenceTotal() |
List<GenericValue> |
getGiftCards() |
GenericValue |
getGiftCertSettingFromStore(Delegator delegator)
Returns ProductStoreFinActSetting based on cart's productStoreId and FinAccountHelper's defined giftCertFinAcctTypeId
|
String |
getGiftMessage() |
String |
getGiftMessage(int idx) |
BigDecimal |
getGrandTotal()
Returns the total from the cart, including tax/shipping.
|
boolean |
getHoldOrder() |
String |
getInternalCode() |
List<String> |
getInternalOrderNotes() |
String |
getIsGift() |
String |
getIsGift(int idx) |
ShoppingCart.ShoppingCartItemGroup |
getItemGroupByNumber(String groupNumber) |
int |
getItemIndex(ShoppingCartItem item)
Returns this item's index.
|
BigDecimal |
getItemShipGroupEstimate(int idx) |
int |
getItemShipGroupIndex(int itemId)
Return index of the ship group where the item is located
|
BigDecimal |
getItemShipGroupQty(int itemIndex,
int idx) |
BigDecimal |
getItemShipGroupQty(ShoppingCartItem item,
int idx) |
static List<GenericValue> |
getItemsProducts(List<ShoppingCartItem> cartItems) |
static BigDecimal |
getItemsTotalQuantity(List<ShoppingCartItem> cartItems) |
BigDecimal |
getItemTotal()
Returns the item-total in the cart (not including discount/tax/shipping).
|
Timestamp |
getLastListRestore() |
List<ShoppingCartItem> |
getLineListOrderedByBasePrice(boolean ascending) |
Locale |
getLocale() |
String |
getMaySplit() |
String |
getMaySplit(int idx)
Returns Boolean.TRUE if the order may be split (null if unspecified)
|
static BigDecimal |
getMinimumOrderQuantity(Delegator delegator,
BigDecimal itemBasePrice,
String itemProductId) |
String |
getOrderAdditionalEmails() |
String |
getOrderAttribute(String name) |
Map<String,String> |
getOrderAttributes() |
Map<String,String> |
getOrderContactMechIds() |
Timestamp |
getOrderDate() |
BigDecimal |
getOrderGlobalAdjustments() |
String |
getOrderId()
Returns the order ID associated with this cart or null if no order has been created yet.
|
String |
getOrderName() |
List<String> |
getOrderNotes() |
BigDecimal |
getOrderOtherAdjustmentTotal() |
String |
getOrderPartyId() |
BigDecimal |
getOrderPaymentPreferenceTotalByType(String paymentMethodTypeId)
Get the total payment amount by payment type.
|
BigDecimal |
getOrderShipping()
Returns the order level shipping amount
|
String |
getOrderStatusId() |
String |
getOrderStatusString() |
List<GenericValue> |
getOrderTerms()
Get a List of orderTerms on the order (ie cart)
|
String |
getOrderType()
Returns the order type.
|
GenericValue |
getOriginAddress(int idx) |
BigDecimal |
getPartyDaysSinceCreated(Timestamp nowTimestamp) |
String |
getPartyId() |
BigDecimal |
getPaymentAmount(String id)
returns the payment method/payment method type amount
|
ShoppingCart.CartPaymentInfo |
getPaymentInfo(int index)
Locates an existing CartPaymentInfo object by index
|
ShoppingCart.CartPaymentInfo |
getPaymentInfo(String id)
Locates an existing (or creates a new) CartPaymentInfo object
|
ShoppingCart.CartPaymentInfo |
getPaymentInfo(String id,
String refNum,
String authCode,
BigDecimal amount)
Locates an existing (or creates a new) CartPaymentInfo object
|
ShoppingCart.CartPaymentInfo |
getPaymentInfo(String id,
String refNum,
String authCode,
BigDecimal amount,
boolean update)
Locates an existing (or creates a new) CartPaymentInfo object
|
int |
getPaymentInfoIndex(String id,
String refNum)
Locates the index of an existing CartPaymentInfo object or -1 if none found
|
List<ShoppingCart.CartPaymentInfo> |
getPaymentInfos(boolean isPaymentMethod,
boolean isPaymentMethodType,
boolean hasRefNum)
Returns the CartPaymentInfo objects which have matching fields
|
List<String> |
getPaymentMethodIds()
Returns the Payment Method Ids
|
List<GenericValue> |
getPaymentMethods()
Returns a list of PaymentMethod value objects selected in the cart
|
String |
getPaymentMethodTypeId(String paymentMethodId) |
List<String> |
getPaymentMethodTypeIds()
Returns the Payment Method Type Ids
|
List<GenericValue> |
getPaymentMethodTypes()
Returns a list of PaymentMethodType value objects selected in the cart
|
String |
getPaymentRef(String id) |
BigDecimal |
getPaymentTotal()
returns the total payment amounts
|
String |
getPlacingCustomerPartyId() |
String |
getPoNumber()
Returns the po number.
|
Set<String> |
getProductPromoCodesEntered() |
int |
getProductPromoCodeUse(String productPromoCodeId) |
BigDecimal |
getProductPromoTotal() |
int |
getProductPromoUseCount(String productPromoId) |
Iterator<ShoppingCart.ProductPromoUseInfo> |
getProductPromoUseInfoIter() |
BigDecimal |
getProductPromoUseTotalDiscount(String productPromoId)
Get total discount for a given ProductPromo, or for ANY ProductPromo if the passed in productPromoId is null.
|
String |
getProductStoreId() |
String |
getProductStoreShipMethId() |
String |
getProductStoreShipMethId(int idx) |
String |
getQuoteId() |
Timestamp |
getShipAfterDate()
Get ship after date for ship group 0
|
Timestamp |
getShipAfterDate(int idx)
Get ship after date for a particular ship group
|
Timestamp |
getShipBeforeDate()
Get ship before date for ship group 0
|
Timestamp |
getShipBeforeDate(int idx)
Get ship before date for a particular ship group
|
String |
getShipFromVendorPartyId() |
String |
getShipGroupFacilityId(int idx) |
Map<ShoppingCartItem,BigDecimal> |
getShipGroupItems(int idx)
Returns the ShoppingCartItem (key) and quantity (value) associated with the ship group
|
List<ShoppingCart.CartShipInfo> |
getShipGroups() |
Map<Integer,BigDecimal> |
getShipGroups(int itemIndex) |
Map<Integer,BigDecimal> |
getShipGroups(ShoppingCartItem item) |
TreeMap<Integer,ShoppingCart.CartShipInfo> |
getShipGroupsBySupplier(String supplierPartyId) |
String |
getShipGroupSeqId(int idx) |
int |
getShipGroupSize() |
String |
getShipGroupVendorPartyId(int idx) |
ShoppingCart.CartShipInfo |
getShipInfo(int idx) |
int |
getShipInfoIndex(String shipGroupSeqId) |
int |
getShipInfoSize() |
GenericValue |
getShipmentMethodType(int idx)
Returns the shipment method type.
|
String |
getShipmentMethodTypeId() |
String |
getShipmentMethodTypeId(int idx)
Returns the shipment method type ID
|
List<Map<String,Object>> |
getShippableItemInfo(int idx)
Returns a List of shippable item info (quantity, size, weight) for a specific ship group
|
BigDecimal |
getShippableQuantity(int idx)
Returns the total SHIPPABLE quantity in the cart for a specific ship group.
|
List<BigDecimal> |
getShippableSizes(int idx)
Returns a List of shippable item's size for a specific ship group.
|
BigDecimal |
getShippableTotal(int idx)
Returns the SHIPPABLE item-total in the cart for a specific ship group.
|
BigDecimal |
getShippableWeight(int idx)
Returns the total SHIPPABLE weight in the cart for a specific ship group.
|
GenericValue |
getShippingAddress() |
GenericValue |
getShippingAddress(int idx) |
String |
getShippingContactMechId() |
String |
getShippingContactMechId(int idx)
Returns the shipping contact mech id.
|
String |
getShippingInstructions() |
String |
getShippingInstructions(int idx)
Returns the shipping instructions.
|
String |
getShipToCustomerPartyId() |
BigDecimal |
getSubTotal()
Returns the sub-total in the cart (item-total - discount).
|
BigDecimal |
getSubTotalForPromotions()
Returns the sub-total in the cart (item-total - discount).
|
BigDecimal |
getSubTotalForPromotions(Set<String> productIds) |
String |
getSupplierAgentPartyId() |
String |
getSupplierAgreementId(int idx)
Returns the supplier Agreement for the given ship group (drop shipment).
|
String |
getSupplierPartyId(int idx)
Returns the supplier for the given ship group (drop shipment).
|
GenericValue |
getSupplierProduct(String productId,
BigDecimal quantity,
LocalDispatcher dispatcher) |
String |
getTerminalId() |
BigDecimal |
getTotalQuantity()
Returns the total quantity in the cart.
|
BigDecimal |
getTotalSalesTax()
Returns the tax amount from the cart object.
|
BigDecimal |
getTotalSalesTax(int shipGroup) |
BigDecimal |
getTotalShipping()
Returns the shipping amount from the cart object.
|
BigDecimal |
getTotalWeight()
Returns the total weight in the cart.
|
String |
getTransactionId() |
GenericValue |
getUserLogin()
Gets the userLogin associated with the cart; may be null
|
String |
getWebSiteId() |
String |
getWorkEffortId() |
void |
handleNewUser(LocalDispatcher dispatcher) |
boolean |
hasOrderTerm(String termTypeId) |
boolean |
isOrderTermSet() |
boolean |
isPaymentMethodType(String id) |
boolean |
isPaymentSelected(String id) |
boolean |
isPinRequiredForGC(Delegator delegator)
Determines whether pin numbers are required for gift cards, based on ProductStoreFinActSetting.
|
boolean |
isPurchaseOrder() |
boolean |
isReadOnlyCart() |
boolean |
isSalesOrder() |
boolean |
isValidateGCFinAccount(Delegator delegator)
Returns whether the cart should validate gift cards against FinAccount (ie, internal gift certificates).
|
List<ShoppingCartItem> |
items()
Returns a Collection of items in the cart object.
|
Iterator<ShoppingCartItem> |
iterator()
Returns an iterator of cart items.
|
List<GenericValue> |
makeAllAdjustments()
make a list of all adjustments including order adjustments, order line adjustments, and special adjustments (shipping and tax if applicable)
|
List<GenericValue> |
makeAllOrderAttributes() |
List<GenericValue> |
makeAllOrderAttributes(String orderId,
int mode) |
List<GenericValue> |
makeAllOrderContactMechs()
make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItems
|
List<GenericValue> |
makeAllOrderItemAssociations() |
List<GenericValue> |
makeAllOrderItemAttributes() |
List<GenericValue> |
makeAllOrderItemAttributes(String orderId,
int mode) |
List<GenericValue> |
makeAllOrderItemContactMechs()
make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItems
|
List<GenericValue> |
makeAllOrderItemPriceInfos()
make a list of OrderItemPriceInfos from the ShoppingCartItems
|
List<GenericValue> |
makeAllOrderItemSurveyResponses()
make a list of SurveyResponse object to update with order information set
|
List<GenericValue> |
makeAllOrderPaymentInfos(LocalDispatcher dispatcher)
make a list of all OrderPaymentPreferences and Billing info including all payment methods and types
|
List<GenericValue> |
makeAllQuoteAdjustments()
make a list of all quote adjustments including header adjustments, line adjustments, and special adjustments (shipping and tax if applicable).
|
List<GenericValue> |
makeAllShipGroupInfos(LocalDispatcher dispatcher)
Return all OrderItemShipGroup, OrderContactMech, OrderAdjustment and OrderItemShipGroupAssoc from ShoppingCart
in a single list of
GenericValue |
Map<String,Object> |
makeCartMap(LocalDispatcher dispatcher,
boolean explodeItems)
Returns a Map of cart values to pass to the storeOrder service
|
List<GenericValue> |
makeOrderItemGroups() |
List<GenericValue> |
makeOrderItems(boolean explodeItems,
boolean replaceAggregatedId,
LocalDispatcher dispatcher) |
List<GenericValue> |
makeOrderItems(LocalDispatcher dispatcher) |
ShoppingCart.CartPaymentInfo |
makePaymentInfo(String id,
String refNum,
BigDecimal amount)
Creates a CartPaymentInfo object
|
ShoppingCart.CartPaymentInfo |
makePaymentInfo(String id,
String refNum,
String authCode,
BigDecimal amount)
Creates a CartPaymentInfo object with a possible authCode (may be null)
|
List<GenericValue> |
makeProductPromoUses() |
List<GenericValue> |
makeWorkEfforts()
create WorkEfforts from the shoppingcart items when itemType = RENTAL_ORDER_ITEM
|
void |
moveCartItem(int fromIndex,
int toIndex)
Moves a line item to a different index.
|
void |
positionItemToGroup(int itemIndex,
BigDecimal quantity,
int fromIndex,
int toIndex,
boolean clearEmptyGroups) |
void |
positionItemToGroup(ShoppingCartItem item,
BigDecimal quantity,
int fromIndex,
int toIndex,
boolean clearEmptyGroups) |
void |
removeAdditionalPartyRole(String partyId,
String roleTypeId)
Removes a previously associated party to the order.
|
void |
removeAdjustment(int index) |
void |
removeAdjustmentByType(String orderAdjustmentTypeId)
go through the order adjustments and remove all adjustments with the given type
|
void |
removeAllDesiredAlternateGiftByActions() |
void |
removeAllFreeShippingProductPromoActions() |
void |
removeAttribute(String name) |
void |
removeCartItem(int index,
LocalDispatcher dispatcher)
Remove an item from the cart object.
|
void |
removeCartItem(ShoppingCartItem item,
LocalDispatcher dispatcher) |
String |
removeContactMech(String contactMechPurposeTypeId)
Remove the contactMechId from this cart given the contactMechPurposeTypeId
|
void |
removeEmptyCartItems()
Remove quantity 0 ShoppingCartItems from the cart object.
|
void |
removeExtraItems(List<ShoppingCartItem> multipleItems,
LocalDispatcher dispatcher,
int maxItems) |
void |
removeFreeShippingProductPromoAction(GenericPK productPromoActionPK)
Removes a free shipping ProductPromoAction by trying to find one in the list with the same primary key.
|
void |
removeOrderAttribute(String name) |
void |
removeOrderTerm(int index) |
void |
removeOrderTerms() |
void |
removeProductPromoUse(String productPromoId) |
void |
resetPromoRuleUse(String productPromoId,
String productPromoRuleId) |
int |
selectedPayments() |
void |
setAgreementId(String agreementId) |
void |
setAllCarrierPartyId(String carrierPartyId)
Sets @param carrierPartyId in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAllGiftMessage(String giftMessage)
Sets @param giftMessage in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAllIsGift(Boolean isGift)
Sets @param isGift in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAllMaySplit(Boolean maySplit)
Sets @param maySplit in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAllProductStoreShipMethId(String productStoreShipMethId)
Sets @param productStoreShipMethId in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAllShipmentMethodTypeId(String shipmentMethodTypeId)
Sets @param shipmentMethodTypeId in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAllShippingContactMechId(String shippingContactMechId)
Sets @param shippingContactMechId in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAllShippingInstructions(String shippingInstructions)
Sets @param shippingInstructions in all ShipInfo(ShipGroups) associated
with this ShoppingCart
|
void |
setAttribute(String name,
Object value) |
void |
setAutoOrderShoppingListId(String autoOrderShoppingListId) |
void |
setAutoSaveListId(String id) |
protected void |
setAutoUserLogin(GenericValue autoUserLogin) |
void |
setAutoUserLogin(GenericValue autoUserLogin,
LocalDispatcher dispatcher) |
void |
setBillFromVendorPartyId(String billFromVendorPartyId) |
void |
setBillingAccount(String billingAccountId,
BigDecimal amount)
Sets the billing account id string.
|
void |
setBillToCustomerPartyId(String billToCustomerPartyId) |
void |
setCancelBackOrderDate(Timestamp cancelBackOrderDate) |
void |
setCarrierPartyId(int idx,
String carrierPartyId) |
void |
setChannelType(String channelType) |
void |
setCurrency(LocalDispatcher dispatcher,
String currencyUom)
Sets the currency for the cart.
|
void |
setDefaultCheckoutOptions(LocalDispatcher dispatcher) |
void |
setDefaultItemComment(String comment) |
void |
setDefaultItemDeliveryDate(String date) |
void |
setDefaultReserveAfterDate(Timestamp defaultReserveAfterDate) |
void |
setDefaultShipAfterDate(Timestamp defaultShipAfterDate) |
void |
setDefaultShipBeforeDate(Timestamp defaultShipBeforeDate) |
void |
setDesiredAlternateGiftByAction(GenericPK productPromoActionPK,
String productId) |
void |
setDoPromotions(boolean doPromotions) |
void |
setEndUserCustomerPartyId(String endUserCustomerPartyId) |
void |
setExternalId(String externalId) |
void |
setFacilityId(String facilityId) |
void |
setFirstAttemptOrderId(String orderId)
TODO: Sets the first attempt orderId for this cart.
|
void |
setGiftMessage(int idx,
String giftMessage) |
void |
setHoldOrder(boolean b) |
void |
setInternalCode(String internalCode) |
void |
setIsGift(int idx,
Boolean isGift) |
void |
setItemShipGroupEstimate(BigDecimal amount,
int idx) |
void |
setItemShipGroupQty(int itemIndex,
BigDecimal quantity,
int idx) |
void |
setItemShipGroupQty(ShoppingCartItem item,
BigDecimal quantity,
int idx) |
void |
setItemShipGroupQty(ShoppingCartItem item,
int itemIndex,
BigDecimal quantity,
int idx) |
void |
setLastListRestore(Timestamp time) |
void |
setLocale(Locale locale) |
void |
setMaySplit(int idx,
Boolean maySplit) |
void |
setNextItemSeq(long seq) |
void |
setOrderAdditionalEmails(String orderAdditionalEmails) |
void |
setOrderAttribute(String name,
String value) |
void |
setOrderAttributes(Map<String,String> orderAttributes) |
void |
setOrderDate(Timestamp t) |
void |
setOrderId(String orderId)
Sets the orderId associated with this cart.
|
void |
setOrderName(String orderName) |
void |
setOrderPartyId(String orderPartyId) |
void |
setOrderStatusId(String orderStatusId) |
void |
setOrderStatusString(String orderStatusString) |
void |
setOrderTermSet(boolean orderTermSet) |
void |
setOrderType(String orderType)
Sets the order type.
|
void |
setPlacingCustomerPartyId(String placingCustomerPartyId) |
void |
setPoNumber(String poNumber)
Sets the PO Number in the cart.
|
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...
|
void |
setProductStoreShipMethId(int idx,
String productStoreShipMethId) |
void |
setQuoteId(String quoteId) |
void |
setReadOnlyCart(boolean readOnlyCart) |
void |
setShipAfterDate(int idx,
Timestamp shipAfterDate)
Set ship after date for a particular ship group
|
void |
setShipAfterDate(Timestamp shipAfterDate)
Set ship after date for a particular ship group
|
void |
setShipBeforeDate(int idx,
Timestamp shipBeforeDate)
Set ship before date for a particular ship group
|
void |
setShipBeforeDate(Timestamp shipBeforeDate)
Set ship before date for ship group 0
|
void |
setShipFromVendorPartyId(String shipFromVendorPartyId) |
void |
setShipGroupFacilityId(int idx,
String facilityId) |
void |
setShipGroupSeqId(int idx,
String shipGroupSeqId) |
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.
|
void |
setShipGroupVendorPartyId(int idx,
String vendorPartyId) |
void |
setShipmentMethodTypeId(int idx,
String shipmentMethodTypeId)
Sets the shipment method type.
|
void |
setShippingContactMechId(int idx,
String shippingContactMechId)
Sets the shipping contact mech id.
|
void |
setShippingInstructions(int idx,
String shippingInstructions)
Sets the shipping instructions.
|
void |
setShipToCustomerPartyId(String shipToCustomerPartyId) |
void |
setSupplierAgentPartyId(String supplierAgentPartyId) |
void |
setSupplierAgreementId(int idx,
String supplierAgreementId)
Sets the supplier agreement for the given ship group (drop shipment).
|
void |
setSupplierPartyId(int idx,
String supplierPartyId)
Sets the supplier for the given ship group (drop shipment).
|
void |
setTerminalId(String terminalId) |
void |
setTransactionId(String transactionId) |
protected void |
setUserLogin(GenericValue userLogin) |
void |
setUserLogin(GenericValue userLogin,
LocalDispatcher dispatcher) |
void |
setViewCartOnAdd(boolean viewCartOnAdd)
Returns true if the user wishes to view the cart everytime an item is added.
|
void |
setWebSiteId(String webSiteId) |
void |
setWorkEffortId(String workEffortId) |
boolean |
shippingApplies()
Returns true when there are shippable items in the cart
|
int |
size()
Returns the number of items in the cart object.
|
boolean |
taxApplies()
Returns true when there are taxable items in the cart
|
boolean |
viewCartOnAdd()
Returns true if the user wishes to view the cart everytime an item is added.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final String module
public static final String resource_error
public static final int ALL
public static final int EMPTY_ONLY
public static final int FILLED_ONLY
public static final int scale
public static final RoundingMode rounding
public static final int taxCalcScale
public static final int taxFinalScale
public static final RoundingMode taxRounding
public static final MathContext generalRounding
protected long nextGroupNumber
protected List<ShoppingCart.CartPaymentInfo> paymentInfo
protected String productStoreId
protected boolean doPromotions
protected String transactionId
protected String facilityId
protected String webSiteId
protected String terminalId
protected String autoOrderShoppingListId
protected String orderPartyId
protected String placingCustomerPartyId
protected String billToCustomerPartyId
protected String shipToCustomerPartyId
protected String endUserCustomerPartyId
protected String billFromVendorPartyId
protected String shipFromVendorPartyId
protected String supplierAgentPartyId
protected GenericValue userLogin
protected GenericValue autoUserLogin
protected Locale locale
protected String currencyUom
protected boolean holdOrder
protected Timestamp orderDate
protected Timestamp cancelBackOrderDate
protected ShoppingCart()
public ShoppingCart(ShoppingCart cart)
public ShoppingCart(Delegator delegator, String productStoreId, String webSiteId, Locale locale, String currencyUom, String billToCustomerPartyId, String billFromVendorPartyId)
public ShoppingCart(Delegator delegator, String productStoreId, String webSiteId, Locale locale, String currencyUom)
public Delegator getDelegator()
public String getProductStoreId()
public boolean getDoPromotions()
public void setDoPromotions(boolean doPromotions)
public void setProductStoreId(String productStoreId)
public String getTransactionId()
public void setTransactionId(String transactionId)
public String getTerminalId()
public void setTerminalId(String terminalId)
public String getAutoOrderShoppingListId()
public void setAutoOrderShoppingListId(String autoOrderShoppingListId)
public String getFacilityId()
public void setFacilityId(String facilityId)
public Locale getLocale()
public void setLocale(Locale locale)
public void setOrderName(String orderName)
public String getOrderName()
public void setWorkEffortId(String workEffortId)
public String getWorkEffortId()
public void removeAttribute(String name)
public <T> T getAttribute(String name)
public void removeOrderAttribute(String name)
public void setHoldOrder(boolean b)
public boolean getHoldOrder()
public void setOrderDate(Timestamp t)
public Timestamp getOrderDate()
public void setCurrency(LocalDispatcher dispatcher, String currencyUom) throws CartItemModifyException
CartItemModifyException
public String getCurrency()
public Timestamp getCartCreatedTime()
public GenericValue getSupplierProduct(String productId, BigDecimal quantity, LocalDispatcher dispatcher)
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
CartItemModifyException
ItemNotFoundException
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
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
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
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
CartItemModifyException
public int addItem(int index, ShoppingCartItem item) throws CartItemModifyException
CartItemModifyException
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
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
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
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
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
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
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
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
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
public int addItemToEnd(ShoppingCartItem item) throws CartItemModifyException
CartItemModifyException
public ShoppingCartItem findCartItem(String productId, Map<String,GenericValue> features, Map<String,Object> attributes, String prodCatalogId, BigDecimal selectedAmount)
public List<ShoppingCartItem> findAllCartItems(String productId)
public List<ShoppingCartItem> findAllCartItems(String productId, String groupNumber)
public List<ShoppingCartItem> findAllCartItemsInCategory(String productCategoryId, String groupNumber)
public void removeEmptyCartItems()
public void removeExtraItems(List<ShoppingCartItem> multipleItems, LocalDispatcher dispatcher, int maxItems) throws CartItemModifyException
CartItemModifyException
public static BigDecimal getItemsTotalQuantity(List<ShoppingCartItem> cartItems)
public static List<GenericValue> getItemsProducts(List<ShoppingCartItem> cartItems)
public void ensureItemsQuantity(List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, BigDecimal quantity) throws CartItemModifyException
CartItemModifyException
public BigDecimal ensureItemsTotalQuantity(List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, BigDecimal quantity) throws CartItemModifyException
CartItemModifyException
public boolean containAnyWorkEffortCartItems()
public boolean containAllWorkEffortCartItems()
public boolean containOnlyDigitalGoods()
public boolean containOnlyDigitalGoods(int shipGroupIdx)
public int getItemIndex(ShoppingCartItem item)
public ShoppingCartItem findCartItem(int index)
public ShoppingCartItem findCartItem(String orderItemSeqId)
public void removeCartItem(ShoppingCartItem item, LocalDispatcher dispatcher) throws CartItemModifyException
CartItemModifyException
public void removeCartItem(int index, LocalDispatcher dispatcher) throws CartItemModifyException
CartItemModifyException
public void moveCartItem(int fromIndex, int toIndex)
public int size()
public List<ShoppingCartItem> items()
public Iterator<ShoppingCartItem> iterator()
iterator
in interface Iterable<ShoppingCartItem>
public ShoppingCart.ShoppingCartItemGroup getItemGroupByNumber(String groupNumber)
public String addItemGroup(String groupName, String parentGroupNumber)
public ShoppingCart.ShoppingCartItemGroup addItemGroup(GenericValue itemGroupValue) throws GenericEntityException
GenericEntityException
public List<ShoppingCartItem> getCartItemsInNoGroup()
public List<ShoppingCartItem> getCartItemsInGroup(String groupNumber)
public void deleteItemGroup(String groupNumber)
public GenericValue getUserLogin()
public void setUserLogin(GenericValue userLogin, LocalDispatcher dispatcher) throws CartItemModifyException
CartItemModifyException
protected void setUserLogin(GenericValue userLogin)
public GenericValue getAutoUserLogin()
public void setAutoUserLogin(GenericValue autoUserLogin, LocalDispatcher dispatcher) throws CartItemModifyException
CartItemModifyException
protected void setAutoUserLogin(GenericValue autoUserLogin)
public void handleNewUser(LocalDispatcher dispatcher) throws CartItemModifyException
CartItemModifyException
public String getExternalId()
public void setExternalId(String externalId)
public String getInternalCode()
public void setInternalCode(String internalCode)
public String getWebSiteId()
public void setWebSiteId(String webSiteId)
public void setShipBeforeDate(int idx, Timestamp shipBeforeDate)
idx
- shipBeforeDate
- public void setShipBeforeDate(Timestamp shipBeforeDate)
shipBeforeDate
- public Timestamp getShipBeforeDate(int idx)
idx
- the ship group numberpublic Timestamp getShipBeforeDate()
public void setShipAfterDate(int idx, Timestamp shipAfterDate)
idx
- the ship group numbershipAfterDate
- the ship after date to be set for the given ship grouppublic void setShipAfterDate(Timestamp shipAfterDate)
shipAfterDate
- the ship after date to be set for the first ship grouppublic Timestamp getShipAfterDate(int idx)
idx
- the ship group numberpublic Timestamp getShipAfterDate()
public void setDefaultShipBeforeDate(Timestamp defaultShipBeforeDate)
public Timestamp getDefaultShipBeforeDate()
public void setDefaultShipAfterDate(Timestamp defaultShipAfterDate)
public void setCancelBackOrderDate(Timestamp cancelBackOrderDate)
public Timestamp getCancelBackOrderDate()
public Timestamp getDefaultShipAfterDate()
public void setDefaultReserveAfterDate(Timestamp defaultReserveAfterDate)
public Timestamp getDefaultReserveAfterDate()
public String getOrderPartyId()
public void setOrderPartyId(String orderPartyId)
public String getPlacingCustomerPartyId()
public void setPlacingCustomerPartyId(String placingCustomerPartyId)
public String getBillToCustomerPartyId()
public void setBillToCustomerPartyId(String billToCustomerPartyId)
public String getShipToCustomerPartyId()
public void setShipToCustomerPartyId(String shipToCustomerPartyId)
public String getEndUserCustomerPartyId()
public void setEndUserCustomerPartyId(String endUserCustomerPartyId)
public String getBillFromVendorPartyId()
public void setBillFromVendorPartyId(String billFromVendorPartyId)
public String getShipFromVendorPartyId()
public void setShipFromVendorPartyId(String shipFromVendorPartyId)
public String getSupplierAgentPartyId()
public void setSupplierAgentPartyId(String supplierAgentPartyId)
public String getPartyId()
public void setAutoSaveListId(String id)
public String getAutoSaveListId()
public void setLastListRestore(Timestamp time)
public Timestamp getLastListRestore()
public BigDecimal getPartyDaysSinceCreated(Timestamp nowTimestamp)
public void clear()
public void setOrderType(String orderType)
public String getOrderType()
public void setChannelType(String channelType)
public String getChannelType()
public boolean isPurchaseOrder()
public boolean isSalesOrder()
public void setPoNumber(String poNumber)
public String getPoNumber()
public void setDefaultItemDeliveryDate(String date)
public String getDefaultItemDeliveryDate()
public void setDefaultItemComment(String comment)
public String getDefaultItemComment()
public void setAgreementId(String agreementId)
public String getAgreementId()
public void setQuoteId(String quoteId)
public String getQuoteId()
public ShoppingCart.CartPaymentInfo makePaymentInfo(String id, String refNum, BigDecimal amount)
public ShoppingCart.CartPaymentInfo makePaymentInfo(String id, String refNum, String authCode, BigDecimal amount)
public int getPaymentInfoIndex(String id, String refNum)
public List<ShoppingCart.CartPaymentInfo> getPaymentInfos(boolean isPaymentMethod, boolean isPaymentMethodType, boolean hasRefNum)
public ShoppingCart.CartPaymentInfo getPaymentInfo(int index)
public ShoppingCart.CartPaymentInfo getPaymentInfo(String id, String refNum, String authCode, BigDecimal amount, boolean update)
public ShoppingCart.CartPaymentInfo getPaymentInfo(String id, String refNum, String authCode, BigDecimal amount)
public ShoppingCart.CartPaymentInfo getPaymentInfo(String id)
public ShoppingCart.CartPaymentInfo addPaymentAmount(String id, BigDecimal amount, String refNum, String authCode, boolean isSingleUse, boolean isPresent, boolean replace)
public ShoppingCart.CartPaymentInfo addPaymentAmount(String id, BigDecimal amount, boolean isSingleUse)
public ShoppingCart.CartPaymentInfo addPaymentAmount(String id, BigDecimal amount)
public ShoppingCart.CartPaymentInfo addPayment(String id)
public BigDecimal getPaymentAmount(String id)
public BigDecimal getPaymentTotal()
public int selectedPayments()
public boolean isPaymentSelected(String id)
public void clearPayment(String id)
public void clearPayment(int index)
public void clearPayments()
public void clearPaymentMethodsById(List<String> paymentMethodIdsToRemove)
public void clearDeclinedPaymentMethods(Delegator delegator)
public List<String> getPaymentMethodTypeIds()
public List<GenericValue> getPaymentMethods()
public List<GenericValue> getPaymentMethodTypes()
public List<GenericValue> getCreditCards()
public List<GenericValue> getGiftCards()
public boolean isPaymentMethodType(String id)
public GenericValue getBillingAddress()
public GenericValue getGiftCertSettingFromStore(Delegator delegator) throws GenericEntityException
delegator
- the delegatorGenericEntityException
public boolean isPinRequiredForGC(Delegator delegator)
delegator
- the delegatorpublic boolean isValidateGCFinAccount(Delegator delegator)
delegator
- the delegatorpublic void setBillingAccount(String billingAccountId, BigDecimal amount)
public String getBillingAccountId()
public BigDecimal getBillingAccountAmount()
public BigDecimal getOrderShipping()
public int addShipInfo()
public List<ShoppingCart.CartShipInfo> getShipGroups()
public Map<Integer,BigDecimal> getShipGroups(ShoppingCartItem item)
public Map<Integer,BigDecimal> getShipGroups(int itemIndex)
public ShoppingCart.CartShipInfo getShipInfo(int idx)
public int getShipGroupSize()
public Map<ShoppingCartItem,BigDecimal> getShipGroupItems(int idx)
public void clearItemShipInfo(ShoppingCartItem item)
public void setItemShipGroupEstimate(BigDecimal amount, int idx)
public void setShipGroupShipDatesFromItem(ShoppingCartItem item)
item
- public BigDecimal getItemShipGroupEstimate(int idx)
public void setItemShipGroupQty(int itemIndex, BigDecimal quantity, int idx)
public void setItemShipGroupQty(ShoppingCartItem item, BigDecimal quantity, int idx)
public void setItemShipGroupQty(ShoppingCartItem item, int itemIndex, BigDecimal quantity, int idx)
public BigDecimal getItemShipGroupQty(ShoppingCartItem item, int idx)
public BigDecimal getItemShipGroupQty(int itemIndex, int idx)
public void positionItemToGroup(int itemIndex, BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
public void positionItemToGroup(ShoppingCartItem item, BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
protected boolean checkShipItemInfo(ShoppingCart.CartShipInfo csi, ShoppingCart.CartShipInfo.CartShipItemInfo csii)
public void cleanUpShipGroups()
public int getShipInfoIndex(String shipGroupSeqId)
public int getItemShipGroupIndex(int itemId)
public void setShippingContactMechId(int idx, String shippingContactMechId)
public void setAllShippingContactMechId(String shippingContactMechId)
shippingContactMechId
- public String getShippingContactMechId(int idx)
public String getShippingContactMechId()
public void setShipmentMethodTypeId(int idx, String shipmentMethodTypeId)
public void setAllShipmentMethodTypeId(String shipmentMethodTypeId)
shipmentMethodTypeId
- public String getShipmentMethodTypeId(int idx)
public String getShipmentMethodTypeId()
public GenericValue getShipmentMethodType(int idx)
public void setSupplierPartyId(int idx, String supplierPartyId)
public String getSupplierPartyId(int idx)
public void setSupplierAgreementId(int idx, String supplierAgreementId)
public String getSupplierAgreementId(int idx)
public void setShippingInstructions(int idx, String shippingInstructions)
public void setAllShippingInstructions(String shippingInstructions)
shippingInstructions
- public String getShippingInstructions(int idx)
public String getShippingInstructions()
public void setMaySplit(int idx, Boolean maySplit)
public void setAllMaySplit(Boolean maySplit)
maySplit
- public String getMaySplit(int idx)
public String getMaySplit()
public void setGiftMessage(int idx, String giftMessage)
public void setAllGiftMessage(String giftMessage)
giftMessage
- public String getGiftMessage(int idx)
public String getGiftMessage()
public void setIsGift(int idx, Boolean isGift)
public void setAllIsGift(Boolean isGift)
isGift
- public String getIsGift(int idx)
public String getIsGift()
public void setCarrierPartyId(int idx, String carrierPartyId)
public void setAllCarrierPartyId(String carrierPartyId)
carrierPartyId
- public String getCarrierPartyId(int idx)
public String getCarrierPartyId()
public String getProductStoreShipMethId(int idx)
public String getProductStoreShipMethId()
public void setProductStoreShipMethId(int idx, String productStoreShipMethId)
public void setAllProductStoreShipMethId(String productStoreShipMethId)
productStoreShipMethId
- public void setShipGroupFacilityId(int idx, String facilityId)
public String getShipGroupFacilityId(int idx)
public void setShipGroupVendorPartyId(int idx, String vendorPartyId)
public String getShipGroupVendorPartyId(int idx)
public void setShipGroupSeqId(int idx, String shipGroupSeqId)
public String getShipGroupSeqId(int idx)
public void setOrderAdditionalEmails(String orderAdditionalEmails)
public String getOrderAdditionalEmails()
public GenericValue getShippingAddress(int idx)
public GenericValue getOriginAddress(int idx)
public GenericValue getShippingAddress()
public void addInternalOrderNote(String note)
public void clearInternalOrderNotes()
public void clearOrderNotes()
public void addOrderNote(String note)
public void setDefaultCheckoutOptions(LocalDispatcher dispatcher)
public BigDecimal getTotalSalesTax(int shipGroup)
public BigDecimal getTotalSalesTax()
public BigDecimal getTotalShipping()
public BigDecimal getItemTotal()
public BigDecimal getSubTotal()
public BigDecimal getGrandTotal()
public BigDecimal getDisplaySubTotal()
public BigDecimal getOrderGlobalAdjustments()
public BigDecimal getDisplayTaxIncluded()
public BigDecimal getDisplayRecurringSubTotal()
public BigDecimal getDisplayGrandTotal()
public BigDecimal getOrderOtherAdjustmentTotal()
public BigDecimal getSubTotalForPromotions()
public BigDecimal getSubTotalForPromotions(Set<String> productIds)
public BigDecimal getOrderPaymentPreferenceTotalByType(String paymentMethodTypeId)
public BigDecimal getCreditCardPaymentPreferenceTotal()
public BigDecimal getBillingAccountPaymentPreferenceTotal()
public BigDecimal getGiftCardPaymentPreferenceTotal()
public void addContactMech(String contactMechPurposeTypeId, String contactMechId)
public String getContactMech(String contactMechPurposeTypeId)
public String removeContactMech(String contactMechPurposeTypeId)
public List<GenericValue> getAdjustments()
public int getAdjustmentPromoIndex(String productPromoId)
public int addAdjustment(GenericValue adjustment)
public void removeAdjustment(int index)
public GenericValue getAdjustment(int index)
public List<GenericValue> getOrderTerms()
public int addOrderTerm(String termTypeId, BigDecimal termValue, Long termDays)
public int addOrderTerm(String termTypeId, BigDecimal termValue, Long termDays, String textValue)
public int addOrderTerm(String termTypeId, String orderItemSeqId, BigDecimal termValue, Long termDays, String textValue, String description)
public int addOrderTerm(GenericValue orderTerm)
public void removeOrderTerm(int index)
public void removeOrderTerms()
public boolean isOrderTermSet()
public void setOrderTermSet(boolean orderTermSet)
public boolean hasOrderTerm(String termTypeId)
public boolean isReadOnlyCart()
public void setReadOnlyCart(boolean readOnlyCart)
public void removeAdjustmentByType(String orderAdjustmentTypeId)
public BigDecimal getTotalWeight()
public BigDecimal getTotalQuantity()
public BigDecimal getShippableTotal(int idx)
public BigDecimal getShippableQuantity(int idx)
public BigDecimal getShippableWeight(int idx)
public List<BigDecimal> getShippableSizes(int idx)
public List<Map<String,Object>> getShippableItemInfo(int idx)
public boolean shippingApplies()
public boolean taxApplies()
public Map<String,BigDecimal> getFeatureIdQtyMap(int idx)
public boolean viewCartOnAdd()
public void setViewCartOnAdd(boolean viewCartOnAdd)
public String getOrderId()
public String getFirstAttemptOrderId()
public void setOrderId(String orderId)
public void setNextItemSeq(long seq) throws GeneralException
GeneralException
public void setFirstAttemptOrderId(String orderId)
public void removeAllFreeShippingProductPromoActions()
public void removeFreeShippingProductPromoAction(GenericPK productPromoActionPK)
public void addFreeShippingProductPromoAction(GenericValue productPromoAction)
public List<GenericValue> getFreeShippingProductPromoActions()
public void removeAllDesiredAlternateGiftByActions()
public void setDesiredAlternateGiftByAction(GenericPK productPromoActionPK, String productId)
public String getDesiredAlternateGiftByAction(GenericPK productPromoActionPK)
public Map<GenericPK,String> getAllDesiredAlternateGiftByActionCopy()
public void addProductPromoUse(String productPromoId, String productPromoCodeId, BigDecimal totalDiscountAmount, BigDecimal quantityLeftInActions, Map<ShoppingCartItem,BigDecimal> usageInfoMap)
public void removeProductPromoUse(String productPromoId)
public void clearProductPromoUseInfo()
public void clearCartItemUseInPromoInfo()
public Iterator<ShoppingCart.ProductPromoUseInfo> getProductPromoUseInfoIter()
public BigDecimal getProductPromoTotal()
public BigDecimal getProductPromoUseTotalDiscount(String productPromoId)
public int getProductPromoUseCount(String productPromoId)
public int getProductPromoCodeUse(String productPromoCodeId)
public void clearAllPromotionInformation()
public void clearAllPromotionAdjustments()
public void clearAllAdjustments()
public void clearAllItemStatus()
public String addProductPromoCode(String productPromoCodeId, LocalDispatcher dispatcher)
productPromoCodeId
- The promotion code to check and addpublic void confirmPromoRuleUse(String productPromoId, String productPromoRuleId)
public void addAdditionalPartyRole(String partyId, String roleTypeId)
partyId
- identifier of the party to associate to orderroleTypeId
- identifier of the role used in party-order associationpublic void removeAdditionalPartyRole(String partyId, String roleTypeId)
partyId
- identifier of the party to associate to orderroleTypeId
- identifier of the role used in party-order associationpublic String getAggregatedInstanceId(ShoppingCartItem item, LocalDispatcher dispatcher)
item
- dispatcher
- public List<GenericValue> makeOrderItemGroups()
public void explodeItems(List<ShoppingCartItem> shoppingCartItems, LocalDispatcher dispatcher)
shoppingCartItems
- dispatcher
- public List<GenericValue> makeOrderItems(LocalDispatcher dispatcher)
public List<GenericValue> makeOrderItems(boolean explodeItems, boolean replaceAggregatedId, LocalDispatcher dispatcher)
public List<GenericValue> makeWorkEfforts()
public List<GenericValue> makeAllAdjustments()
public List<GenericValue> makeAllQuoteAdjustments()
public List<GenericValue> makeAllOrderPaymentInfos(LocalDispatcher dispatcher)
public List<GenericValue> makeAllOrderItemPriceInfos()
public List<GenericValue> makeProductPromoUses()
public List<GenericValue> makeAllOrderItemSurveyResponses()
public List<GenericValue> makeAllOrderContactMechs()
public List<GenericValue> makeAllOrderItemContactMechs()
public List<GenericValue> makeAllShipGroupInfos(LocalDispatcher dispatcher)
GenericValue
dispatcher
- public int getShipInfoSize()
public List<GenericValue> makeAllOrderItemAttributes()
public List<GenericValue> makeAllOrderItemAttributes(String orderId, int mode)
public List<GenericValue> makeAllOrderAttributes()
public List<GenericValue> makeAllOrderAttributes(String orderId, int mode)
public List<GenericValue> makeAllOrderItemAssociations()
public Map<String,Object> makeCartMap(LocalDispatcher dispatcher, boolean explodeItems)
public List<ShoppingCartItem> getLineListOrderedByBasePrice(boolean ascending)
public TreeMap<Integer,ShoppingCart.CartShipInfo> getShipGroupsBySupplier(String supplierPartyId)
public void createDropShipGroups(LocalDispatcher dispatcher) throws CartItemModifyException
dispatcher
- CartItemModifyException
public String getOrderStatusId()
public void setOrderStatusId(String orderStatusId)
public String getOrderStatusString()
public void setOrderStatusString(String orderStatusString)
public static BigDecimal getMinimumOrderQuantity(Delegator delegator, BigDecimal itemBasePrice, String itemProductId) throws GenericEntityException
GenericEntityException