Class ShoppingCart
- java.lang.Object
-
- org.apache.ofbiz.order.shoppingcart.ShoppingCart
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<ShoppingCartItem>
- Direct Known Subclasses:
WebShoppingCart
public class ShoppingCart extends java.lang.Object implements java.lang.Iterable<ShoppingCartItem>, java.io.Serializable
Shopping Cart Object- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShoppingCart.CartPaymentInfo
static class
ShoppingCart.CartShipInfo
static class
ShoppingCart.ProductPromoUseInfo
static class
ShoppingCart.ShoppingCartItemGroup
-
Field Summary
Fields Modifier and Type Field Description static int
ALL
protected java.lang.String
autoOrderShoppingListId
protected GenericValue
autoUserLogin
protected java.lang.String
billFromVendorPartyId
protected java.lang.String
billToCustomerPartyId
protected java.sql.Timestamp
cancelBackOrderDate
protected java.lang.String
currencyUom
protected boolean
doPromotions
static int
EMPTY_ONLY
protected java.lang.String
endUserCustomerPartyId
protected java.lang.String
facilityId
static int
FILLED_ONLY
static java.math.MathContext
generalRounding
protected boolean
holdOrder
protected java.util.Locale
locale
static java.lang.String
module
protected long
nextGroupNumber
protected java.sql.Timestamp
orderDate
protected java.lang.String
orderPartyId
General partyId for the Order, all other IDs default to this one if not specified explicitlyprotected java.util.List<ShoppingCart.CartPaymentInfo>
paymentInfo
protected java.lang.String
placingCustomerPartyId
protected java.lang.String
productStoreId
static java.lang.String
resource_error
static java.math.RoundingMode
rounding
static int
scale
protected java.lang.String
shipFromVendorPartyId
protected java.lang.String
shipToCustomerPartyId
protected java.lang.String
supplierAgentPartyId
static int
taxCalcScale
static int
taxFinalScale
static java.math.RoundingMode
taxRounding
protected java.lang.String
terminalId
protected java.lang.String
transactionId
protected GenericValue
userLogin
protected java.lang.String
webSiteId
-
Constructor Summary
Constructors Modifier Constructor Description protected
ShoppingCart()
don't allow empty constructorShoppingCart(Delegator delegator, java.lang.String productStoreId, java.lang.String webSiteId, java.util.Locale locale, java.lang.String currencyUom)
Creates new empty ShoppingCart object.ShoppingCart(Delegator delegator, java.lang.String productStoreId, java.lang.String webSiteId, java.util.Locale locale, java.lang.String currencyUom, java.lang.String billToCustomerPartyId, java.lang.String billFromVendorPartyId)
Creates new empty ShoppingCart object.ShoppingCart(Delegator delegator, java.lang.String productStoreId, java.util.Locale locale, java.lang.String currencyUom)
Creates a new empty ShoppingCart object.ShoppingCart(ShoppingCart cart)
Creates a new cloned ShoppingCart Object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalPartyRole(java.lang.String partyId, java.lang.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 createdvoid
addContactMech(java.lang.String contactMechPurposeTypeId, java.lang.String contactMechId)
Add a contact mech to this purpose; the contactMechPurposeTypeId is requiredvoid
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(java.lang.String note)
int
addItem(int index, ShoppingCartItem item)
Add an item to the shopping cart.java.lang.String
addItemGroup(java.lang.String groupName, java.lang.String parentGroupNumber)
Creates a new Item Group and returns the groupNumber that represents itShoppingCart.ShoppingCartItemGroup
addItemGroup(GenericValue itemGroupValue)
int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules)
Add an accommodation(rental)item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks)
Add an accommodation(rental)item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersonsDbl, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks)
Add an accommodation(rental/aggregated)item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules)
Add an (rental)item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks)
Add an (rental)item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks)
Add an (rental/aggregated)item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, ProductConfigWrapper configWrapper, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules)
Add an item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules)
Add an item to the shopping cart.int
addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks)
Add an item to the shopping cart.int
addItemToEnd(ShoppingCartItem item)
Add an item to the shopping cart.int
addNonProductItem(java.lang.String itemType, java.lang.String description, java.lang.String categoryId, java.math.BigDecimal price, java.math.BigDecimal quantity, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemGroupNumber, LocalDispatcher dispatcher)
Add a non-product item to the shopping cart.void
addOrderNote(java.lang.String note)
int
addOrderTerm(java.lang.String termTypeId, java.lang.String orderItemSeqId, java.math.BigDecimal termValue, java.lang.Long termDays, java.lang.String textValue, java.lang.String description)
int
addOrderTerm(java.lang.String termTypeId, java.math.BigDecimal termValue, java.lang.Long termDays)
Add an orderTerm to the orderint
addOrderTerm(java.lang.String termTypeId, java.math.BigDecimal termValue, java.lang.Long termDays, java.lang.String textValue)
Add an orderTerm to the orderint
addOrderTerm(GenericValue orderTerm)
Add an orderTerm to the orderint
addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.sql.Timestamp reserveAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,java.lang.String> orderItemAttributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher)
add rental (with accommodation) item to cart and order item attributesint
addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher)
add rental (with accommodation) item to cartint
addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,java.lang.String> orderItemAttributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher)
add rental (with accommodation) item to cart and order item attributesint
addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher)
Add an item to the shopping cart, or if already there, increase the quantity.ShoppingCart.CartPaymentInfo
addPayment(java.lang.String id)
adds a payment method/payment method typeShoppingCart.CartPaymentInfo
addPaymentAmount(java.lang.String id, java.math.BigDecimal amount)
adds a payment method/payment method typeShoppingCart.CartPaymentInfo
addPaymentAmount(java.lang.String id, java.math.BigDecimal amount, boolean isSingleUse)
adds a payment method/payment method typeShoppingCart.CartPaymentInfo
addPaymentAmount(java.lang.String id, java.math.BigDecimal amount, java.lang.String refNum, java.lang.String authCode, boolean isSingleUse, boolean isPresent, boolean replace)
adds a payment method/payment method typevoid
addPaymentRef(java.lang.String id, java.lang.String ref, java.lang.String authCode)
java.lang.String
addProductPromoCode(java.lang.String productPromoCodeId, LocalDispatcher dispatcher)
Adds a promotion code to the cart, checking if it is valid.void
addProductPromoUse(java.lang.String productPromoId, java.lang.String productPromoCodeId, java.math.BigDecimal totalDiscountAmount, java.math.BigDecimal quantityLeftInActions, java.util.Map<ShoppingCartItem,java.math.BigDecimal> usageInfoMap)
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 listvoid
clearPayment(java.lang.String id)
removes a specific payment method/payment method typevoid
clearPaymentMethodsById(java.util.List<java.lang.String> paymentMethodIdsToRemove)
remove all the paymentMethods based on the paymentMethodIdsvoid
clearPayments()
clears all payment method/payment method typesvoid
clearProductPromoUseInfo()
void
confirmPromoRuleUse(java.lang.String productPromoId, java.lang.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.java.util.Map<java.lang.String,java.lang.Object>
createDropShipGroups(LocalDispatcher dispatcher)
Examine each item of each ship group and create new ship groups if the item should be drop shippedvoid
deleteItemGroup(java.lang.String groupNumber)
void
ensureItemsQuantity(java.util.List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, java.math.BigDecimal quantity)
java.math.BigDecimal
ensureItemsTotalQuantity(java.util.List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, java.math.BigDecimal quantity)
void
explodeItems(java.util.List<ShoppingCartItem> shoppingCartItems, LocalDispatcher dispatcher)
Does an "explode", or "unitize" operation on a list of cart items.java.util.List<ShoppingCartItem>
findAllCartItems(java.lang.String productId)
Get all ShoppingCartItems from the cart object with the given productId.java.util.List<ShoppingCartItem>
findAllCartItems(java.lang.String productId, java.lang.String groupNumber)
Get all ShoppingCartItems from the cart object with the given productId and optional groupNumber to limit it to a specific item groupjava.util.List<ShoppingCartItem>
findAllCartItemsInCategory(java.lang.String productCategoryId, java.lang.String groupNumber)
Get all ShoppingCartItems from the cart object with the given productCategoryId and optional groupNumber to limit it to a specific item groupShoppingCartItem
findCartItem(int index)
Get a ShoppingCartItem from the cart object.ShoppingCartItem
findCartItem(java.lang.String orderItemSeqId)
ShoppingCartItem
findCartItem(java.lang.String productId, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.math.BigDecimal selectedAmount)
Get a ShoppingCartItem from the cart object.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getAdditionalPartyRoleMap()
GenericValue
getAdjustment(int index)
int
getAdjustmentPromoIndex(java.lang.String productPromoId)
java.util.List<GenericValue>
getAdjustments()
Get a List of adjustments on the order (ie cart)java.lang.String
getAggregatedInstanceId(ShoppingCartItem item, LocalDispatcher dispatcher)
Returns the Id of an AGGREGATED_CONF product having exact configId.java.lang.String
getAgreementId()
java.util.Map<GenericPK,java.lang.String>
getAllDesiredAlternateGiftByActionCopy()
<T> T
getAttribute(java.lang.String name)
java.lang.String
getAutoOrderShoppingListId()
java.lang.String
getAutoSaveListId()
GenericValue
getAutoUserLogin()
java.lang.String
getBillFromVendorPartyId()
java.math.BigDecimal
getBillingAccountAmount()
Returns the amount to be billed to the billing account.java.lang.String
getBillingAccountId()
Returns the billing message string.java.math.BigDecimal
getBillingAccountPaymentPreferenceTotal()
GenericValue
getBillingAddress()
java.lang.String
getBillToCustomerPartyId()
java.sql.Timestamp
getCancelBackOrderDate()
java.lang.String
getCarrierPartyId()
java.lang.String
getCarrierPartyId(int idx)
java.sql.Timestamp
getCartCreatedTime()
java.util.List<ShoppingCartItem>
getCartItemsInGroup(java.lang.String groupNumber)
java.util.List<ShoppingCartItem>
getCartItemsInNoGroup()
java.lang.String
getChannelType()
java.lang.String
getContactMech(java.lang.String contactMechPurposeTypeId)
Get the contactMechId for this cart given the contactMechPurposeTypeIdjava.math.BigDecimal
getCreditCardPaymentPreferenceTotal()
java.util.List<GenericValue>
getCreditCards()
java.lang.String
getCurrency()
Get the current currency setting.java.lang.String
getDefaultItemComment()
java.lang.String
getDefaultItemDeliveryDate()
java.sql.Timestamp
getDefaultReserveAfterDate()
java.sql.Timestamp
getDefaultShipAfterDate()
java.sql.Timestamp
getDefaultShipBeforeDate()
Delegator
getDelegator()
java.lang.String
getDesiredAlternateGiftByAction(GenericPK productPromoActionPK)
java.math.BigDecimal
getDisplayGrandTotal()
Returns the total from the cart, including tax/shipping.java.math.BigDecimal
getDisplayRecurringSubTotal()
java.math.BigDecimal
getDisplaySubTotal()
java.math.BigDecimal
getDisplayTaxIncluded()
boolean
getDoPromotions()
java.lang.String
getEndUserCustomerPartyId()
java.lang.String
getExternalId()
java.lang.String
getFacilityId()
java.util.Map<java.lang.String,java.math.BigDecimal>
getFeatureIdQtyMap(int idx)
Returns a Map of all features applied to products in the cart with quantities for a specific ship group.java.lang.String
getFirstAttemptOrderId()
Returns the first attempt order ID associated with this cart or null if no order has been created yet.java.util.List<GenericValue>
getFreeShippingProductPromoActions()
java.math.BigDecimal
getGiftCardPaymentPreferenceTotal()
java.util.List<GenericValue>
getGiftCards()
GenericValue
getGiftCertSettingFromStore(Delegator delegator)
Returns ProductStoreFinActSetting based on cart's productStoreId and FinAccountHelper's defined giftCertFinAcctTypeIdjava.lang.String
getGiftMessage()
java.lang.String
getGiftMessage(int idx)
java.math.BigDecimal
getGrandTotal()
Returns the total from the cart, including tax/shipping.boolean
getHoldOrder()
java.lang.String
getInternalCode()
java.util.List<java.lang.String>
getInternalOrderNotes()
java.lang.String
getIsGift()
java.lang.String
getIsGift(int idx)
ShoppingCart.ShoppingCartItemGroup
getItemGroupByNumber(java.lang.String groupNumber)
int
getItemIndex(ShoppingCartItem item)
Returns this item's index.java.math.BigDecimal
getItemShipGroupEstimate(int idx)
int
getItemShipGroupIndex(int itemId)
Return index of the ship group where the item is locatedjava.math.BigDecimal
getItemShipGroupQty(int itemIndex, int idx)
java.math.BigDecimal
getItemShipGroupQty(ShoppingCartItem item, int idx)
static java.util.List<GenericValue>
getItemsProducts(java.util.List<ShoppingCartItem> cartItems)
static java.math.BigDecimal
getItemsTotalQuantity(java.util.List<ShoppingCartItem> cartItems)
java.math.BigDecimal
getItemTotal()
Returns the item-total in the cart (not including discount/tax/shipping).java.sql.Timestamp
getLastListRestore()
java.util.List<ShoppingCartItem>
getLineListOrderedByBasePrice(boolean ascending)
java.util.Locale
getLocale()
java.lang.String
getMaySplit()
java.lang.String
getMaySplit(int idx)
Returns Boolean.TRUE if the order may be split (null if unspecified)static java.math.BigDecimal
getMinimumOrderQuantity(Delegator delegator, java.math.BigDecimal itemBasePrice, java.lang.String itemProductId)
java.lang.String
getOrderAdditionalEmails()
java.lang.String
getOrderAttribute(java.lang.String name)
java.util.Map<java.lang.String,java.lang.String>
getOrderAttributes()
java.util.Map<java.lang.String,java.lang.String>
getOrderContactMechIds()
java.sql.Timestamp
getOrderDate()
java.math.BigDecimal
getOrderGlobalAdjustments()
java.lang.String
getOrderId()
Returns the order ID associated with this cart or null if no order has been created yet.java.lang.String
getOrderName()
java.util.List<java.lang.String>
getOrderNotes()
java.math.BigDecimal
getOrderOtherAdjustmentTotal()
java.lang.String
getOrderPartyId()
java.math.BigDecimal
getOrderPaymentPreferenceTotalByType(java.lang.String paymentMethodTypeId)
Get the total payment amount by payment type.java.math.BigDecimal
getOrderShipping()
Returns the order level shipping amountjava.lang.String
getOrderStatusId()
java.lang.String
getOrderStatusString()
java.util.List<GenericValue>
getOrderTerms()
Get a List of orderTerms on the order (ie cart)java.lang.String
getOrderType()
Returns the order type.GenericValue
getOriginAddress(int idx)
java.math.BigDecimal
getPartyDaysSinceCreated(java.sql.Timestamp nowTimestamp)
java.lang.String
getPartyId()
java.math.BigDecimal
getPaymentAmount(java.lang.String id)
returns the payment method/payment method type amountShoppingCart.CartPaymentInfo
getPaymentInfo(int index)
Locates an existing CartPaymentInfo object by indexShoppingCart.CartPaymentInfo
getPaymentInfo(java.lang.String id)
Locates an existing (or creates a new) CartPaymentInfo objectShoppingCart.CartPaymentInfo
getPaymentInfo(java.lang.String id, java.lang.String refNum, java.lang.String authCode, java.math.BigDecimal amount)
Locates an existing (or creates a new) CartPaymentInfo objectShoppingCart.CartPaymentInfo
getPaymentInfo(java.lang.String id, java.lang.String refNum, java.lang.String authCode, java.math.BigDecimal amount, boolean update)
Locates an existing (or creates a new) CartPaymentInfo objectint
getPaymentInfoIndex(java.lang.String id, java.lang.String refNum)
Locates the index of an existing CartPaymentInfo object or -1 if none foundjava.util.List<ShoppingCart.CartPaymentInfo>
getPaymentInfos(boolean isPaymentMethod, boolean isPaymentMethodType, boolean hasRefNum)
Returns the CartPaymentInfo objects which have matching fieldsjava.util.List<java.lang.String>
getPaymentMethodIds()
Returns the Payment Method Idsjava.util.List<GenericValue>
getPaymentMethods()
Returns a list of PaymentMethod value objects selected in the cartjava.lang.String
getPaymentMethodTypeId(java.lang.String paymentMethodId)
java.util.List<java.lang.String>
getPaymentMethodTypeIds()
Returns the Payment Method Type Idsjava.util.List<GenericValue>
getPaymentMethodTypes()
Returns a list of PaymentMethodType value objects selected in the cartjava.lang.String
getPaymentRef(java.lang.String id)
java.math.BigDecimal
getPaymentTotal()
returns the total payment amountsjava.lang.String
getPlacingCustomerPartyId()
java.lang.String
getPoNumber()
Returns the po number.java.util.Set<java.lang.String>
getProductPromoCodesEntered()
int
getProductPromoCodeUse(java.lang.String productPromoCodeId)
java.math.BigDecimal
getProductPromoTotal()
int
getProductPromoUseCount(java.lang.String productPromoId)
java.util.Iterator<ShoppingCart.ProductPromoUseInfo>
getProductPromoUseInfoIter()
java.math.BigDecimal
getProductPromoUseTotalDiscount(java.lang.String productPromoId)
Get total discount for a given ProductPromo, or for ANY ProductPromo if the passed in productPromoId is null.java.lang.String
getProductStoreId()
java.lang.String
getProductStoreShipMethId()
java.lang.String
getProductStoreShipMethId(int idx)
java.lang.String
getQuoteId()
java.sql.Timestamp
getShipAfterDate()
Get ship after date for ship group 0java.sql.Timestamp
getShipAfterDate(int idx)
Get ship after date for a particular ship groupjava.sql.Timestamp
getShipBeforeDate()
Get ship before date for ship group 0java.sql.Timestamp
getShipBeforeDate(int idx)
Get ship before date for a particular ship groupjava.lang.String
getShipFromVendorPartyId()
java.lang.String
getShipGroupFacilityId(int idx)
java.util.Map<ShoppingCartItem,java.math.BigDecimal>
getShipGroupItems(int idx)
Returns the ShoppingCartItem (key) and quantity (value) associated with the ship groupjava.util.List<ShoppingCart.CartShipInfo>
getShipGroups()
java.util.Map<java.lang.Integer,java.math.BigDecimal>
getShipGroups(int itemIndex)
java.util.Map<java.lang.Integer,java.math.BigDecimal>
getShipGroups(ShoppingCartItem item)
java.util.TreeMap<java.lang.Integer,ShoppingCart.CartShipInfo>
getShipGroupsBySupplier(java.lang.String supplierPartyId)
java.lang.String
getShipGroupSeqId(int idx)
int
getShipGroupSize()
java.lang.String
getShipGroupVendorPartyId(int idx)
ShoppingCart.CartShipInfo
getShipInfo(int idx)
int
getShipInfoIndex(java.lang.String shipGroupSeqId)
int
getShipInfoSize()
GenericValue
getShipmentMethodType(int idx)
Returns the shipment method type.java.lang.String
getShipmentMethodTypeId()
java.lang.String
getShipmentMethodTypeId(int idx)
Returns the shipment method type IDjava.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getShippableItemInfo(int idx)
Returns a List of shippable item info (quantity, size, weight) for a specific ship groupjava.math.BigDecimal
getShippableQuantity(int idx)
Returns the total SHIPPABLE quantity in the cart for a specific ship group.java.util.List<java.math.BigDecimal>
getShippableSizes(int idx)
Returns a List of shippable item's size for a specific ship group.java.math.BigDecimal
getShippableTotal(int idx)
Returns the SHIPPABLE item-total in the cart for a specific ship group.java.math.BigDecimal
getShippableWeight(int idx)
Returns the total SHIPPABLE weight in the cart for a specific ship group.GenericValue
getShippingAddress()
GenericValue
getShippingAddress(int idx)
java.lang.String
getShippingContactMechId()
java.lang.String
getShippingContactMechId(int idx)
Returns the shipping contact mech id.java.lang.String
getShippingInstructions()
java.lang.String
getShippingInstructions(int idx)
Returns the shipping instructions.java.lang.String
getShipToCustomerPartyId()
java.math.BigDecimal
getSubTotal()
Returns the sub-total in the cart (item-total - discount).java.math.BigDecimal
getSubTotalForPromotions()
Returns the sub-total in the cart (item-total - discount).java.math.BigDecimal
getSubTotalForPromotions(java.util.Set<java.lang.String> productIds)
java.lang.String
getSupplierAgentPartyId()
java.lang.String
getSupplierAgreementId(int idx)
Returns the supplier Agreement for the given ship group (drop shipment).java.lang.String
getSupplierPartyId(int idx)
Returns the supplier for the given ship group (drop shipment).GenericValue
getSupplierProduct(java.lang.String productId, java.math.BigDecimal quantity, LocalDispatcher dispatcher)
java.lang.String
getTerminalId()
java.math.BigDecimal
getTotalQuantity()
Returns the total quantity in the cart.java.math.BigDecimal
getTotalSalesTax()
Returns the tax amount from the cart object.java.math.BigDecimal
getTotalSalesTax(int shipGroup)
java.math.BigDecimal
getTotalShipping()
Returns the shipping amount from the cart object.java.math.BigDecimal
getTotalWeight()
Returns the total weight in the cart.java.lang.String
getTransactionId()
GenericValue
getUserLogin()
Gets the userLogin associated with the cart; may be nulljava.lang.String
getWebSiteId()
java.lang.String
getWorkEffortId()
void
handleNewUser(LocalDispatcher dispatcher)
boolean
hasOrderTerm(java.lang.String termTypeId)
boolean
isOrderTermSet()
boolean
isPaymentMethodType(java.lang.String id)
boolean
isPaymentSelected(java.lang.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).java.util.List<ShoppingCartItem>
items()
Returns a Collection of items in the cart object.java.util.Iterator<ShoppingCartItem>
iterator()
Returns an iterator of cart items.java.util.List<GenericValue>
makeAllAdjustments()
make a list of all adjustments including order adjustments, order line adjustments, and special adjustments (shipping and tax if applicable)java.util.List<GenericValue>
makeAllOrderAttributes()
java.util.List<GenericValue>
makeAllOrderAttributes(java.lang.String orderId, int mode)
java.util.List<GenericValue>
makeAllOrderContactMechs()
make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItemsjava.util.List<GenericValue>
makeAllOrderItemAssociations()
java.util.List<GenericValue>
makeAllOrderItemAttributes()
java.util.List<GenericValue>
makeAllOrderItemAttributes(java.lang.String orderId, int mode)
java.util.List<GenericValue>
makeAllOrderItemContactMechs()
make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItemsjava.util.List<GenericValue>
makeAllOrderItemPriceInfos()
make a list of OrderItemPriceInfos from the ShoppingCartItemsjava.util.List<GenericValue>
makeAllOrderItemSurveyResponses()
make a list of SurveyResponse object to update with order information setjava.util.List<GenericValue>
makeAllOrderPaymentInfos(LocalDispatcher dispatcher)
make a list of all OrderPaymentPreferences and Billing info including all payment methods and typesjava.util.List<GenericValue>
makeAllQuoteAdjustments()
make a list of all quote adjustments including header adjustments, line adjustments, and special adjustments (shipping and tax if applicable).java.util.List<GenericValue>
makeAllShipGroupInfos(LocalDispatcher dispatcher)
Return all OrderItemShipGroup, OrderContactMech, OrderAdjustment and OrderItemShipGroupAssoc from ShoppingCart in a single list ofGenericValue
java.util.Map<java.lang.String,java.lang.Object>
makeCartMap(LocalDispatcher dispatcher, boolean explodeItems)
Returns a Map of cart values to pass to the storeOrder servicejava.util.List<GenericValue>
makeOrderItemGroups()
java.util.List<GenericValue>
makeOrderItems(boolean explodeItems, boolean replaceAggregatedId, LocalDispatcher dispatcher)
java.util.List<GenericValue>
makeOrderItems(LocalDispatcher dispatcher)
ShoppingCart.CartPaymentInfo
makePaymentInfo(java.lang.String id, java.lang.String refNum, java.lang.String authCode, java.math.BigDecimal amount)
Creates a CartPaymentInfo object with a possible authCode (may be null)ShoppingCart.CartPaymentInfo
makePaymentInfo(java.lang.String id, java.lang.String refNum, java.math.BigDecimal amount)
Creates a CartPaymentInfo objectjava.util.List<GenericValue>
makeProductPromoUses()
java.util.List<GenericValue>
makeWorkEfforts()
create WorkEfforts from the shoppingcart items when itemType = RENTAL_ORDER_ITEMvoid
moveCartItem(int fromIndex, int toIndex)
Moves a line item to a different index.void
positionItemToGroup(int itemIndex, java.math.BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
void
positionItemToGroup(ShoppingCartItem item, java.math.BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
void
removeAdditionalPartyRole(java.lang.String partyId, java.lang.String roleTypeId)
Removes a previously associated party to the order.void
removeAdjustment(int index)
void
removeAdjustmentByType(java.lang.String orderAdjustmentTypeId)
go through the order adjustments and remove all adjustments with the given typevoid
removeAllDesiredAlternateGiftByActions()
void
removeAllFreeShippingProductPromoActions()
void
removeAttribute(java.lang.String name)
void
removeCartItem(int index, LocalDispatcher dispatcher)
Remove an item from the cart object.void
removeCartItem(ShoppingCartItem item, LocalDispatcher dispatcher)
java.lang.String
removeContactMech(java.lang.String contactMechPurposeTypeId)
Remove the contactMechId from this cart given the contactMechPurposeTypeIdvoid
removeEmptyCartItems()
Remove quantity 0 ShoppingCartItems from the cart object.void
removeExtraItems(java.util.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(java.lang.String name)
void
removeOrderTerm(int index)
void
removeOrderTerms()
void
removeProductPromoUse(java.lang.String productPromoId)
void
resetPromoRuleUse(java.lang.String productPromoId, java.lang.String productPromoRuleId)
int
selectedPayments()
void
setAgreementId(java.lang.String agreementId)
void
setAllCarrierPartyId(java.lang.String carrierPartyId)
Sets @param carrierPartyId in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAllGiftMessage(java.lang.String giftMessage)
Sets @param giftMessage in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAllIsGift(java.lang.Boolean isGift)
Sets @param isGift in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAllMaySplit(java.lang.Boolean maySplit)
Sets @param maySplit in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAllProductStoreShipMethId(java.lang.String productStoreShipMethId)
Sets @param productStoreShipMethId in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAllShipmentMethodTypeId(java.lang.String shipmentMethodTypeId)
Sets @param shipmentMethodTypeId in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAllShippingContactMechId(java.lang.String shippingContactMechId)
Sets @param shippingContactMechId in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAllShippingInstructions(java.lang.String shippingInstructions)
Sets @param shippingInstructions in all ShipInfo(ShipGroups) associated with this ShoppingCartvoid
setAttribute(java.lang.String name, java.lang.Object value)
void
setAutoOrderShoppingListId(java.lang.String autoOrderShoppingListId)
void
setAutoSaveListId(java.lang.String id)
protected void
setAutoUserLogin(GenericValue autoUserLogin)
void
setAutoUserLogin(GenericValue autoUserLogin, LocalDispatcher dispatcher)
void
setBillFromVendorPartyId(java.lang.String billFromVendorPartyId)
void
setBillingAccount(java.lang.String billingAccountId, java.math.BigDecimal amount)
Sets the billing account id string.void
setBillToCustomerPartyId(java.lang.String billToCustomerPartyId)
void
setCancelBackOrderDate(java.sql.Timestamp cancelBackOrderDate)
void
setCarrierPartyId(int idx, java.lang.String carrierPartyId)
void
setChannelType(java.lang.String channelType)
void
setCurrency(LocalDispatcher dispatcher, java.lang.String currencyUom)
Sets the currency for the cart.void
setDefaultCheckoutOptions(LocalDispatcher dispatcher)
void
setDefaultItemComment(java.lang.String comment)
void
setDefaultItemDeliveryDate(java.lang.String date)
void
setDefaultReserveAfterDate(java.sql.Timestamp defaultReserveAfterDate)
void
setDefaultShipAfterDate(java.sql.Timestamp defaultShipAfterDate)
void
setDefaultShipBeforeDate(java.sql.Timestamp defaultShipBeforeDate)
void
setDesiredAlternateGiftByAction(GenericPK productPromoActionPK, java.lang.String productId)
void
setDoPromotions(boolean doPromotions)
void
setEndUserCustomerPartyId(java.lang.String endUserCustomerPartyId)
void
setExternalId(java.lang.String externalId)
void
setFacilityId(java.lang.String facilityId)
void
setFirstAttemptOrderId(java.lang.String orderId)
TODO: Sets the first attempt orderId for this cart.void
setGiftMessage(int idx, java.lang.String giftMessage)
void
setHoldOrder(boolean b)
void
setInternalCode(java.lang.String internalCode)
void
setIsGift(int idx, java.lang.Boolean isGift)
void
setItemShipGroupEstimate(java.math.BigDecimal amount, int idx)
void
setItemShipGroupQty(int itemIndex, java.math.BigDecimal quantity, int idx)
void
setItemShipGroupQty(ShoppingCartItem item, int itemIndex, java.math.BigDecimal quantity, int idx)
void
setItemShipGroupQty(ShoppingCartItem item, java.math.BigDecimal quantity, int idx)
void
setLastListRestore(java.sql.Timestamp time)
void
setLocale(java.util.Locale locale)
void
setMaySplit(int idx, java.lang.Boolean maySplit)
void
setNextItemSeq(long seq)
void
setOrderAdditionalEmails(java.lang.String orderAdditionalEmails)
void
setOrderAttribute(java.lang.String name, java.lang.String value)
void
setOrderAttributes(java.util.Map<java.lang.String,java.lang.String> orderAttributes)
void
setOrderDate(java.sql.Timestamp t)
void
setOrderId(java.lang.String orderId)
Sets the orderId associated with this cart.void
setOrderName(java.lang.String orderName)
void
setOrderPartyId(java.lang.String orderPartyId)
void
setOrderStatusId(java.lang.String orderStatusId)
void
setOrderStatusString(java.lang.String orderStatusString)
void
setOrderTermSet(boolean orderTermSet)
void
setOrderType(java.lang.String orderType)
Sets the order type.void
setPlacingCustomerPartyId(java.lang.String placingCustomerPartyId)
void
setPoNumber(java.lang.String poNumber)
Sets the PO Number in the cart.void
setProductStoreId(java.lang.String productStoreId)
This is somewhat of a dangerous method, changing the productStoreId changes a lot of stuff including: - some items in the cart may not be valid in any catalog in the new store - promotions need to be recalculated for the products that remain - what else? lots of settings on the ProductStore...void
setProductStoreShipMethId(int idx, java.lang.String productStoreShipMethId)
void
setQuoteId(java.lang.String quoteId)
void
setReadOnlyCart(boolean readOnlyCart)
void
setShipAfterDate(int idx, java.sql.Timestamp shipAfterDate)
Set ship after date for a particular ship groupvoid
setShipAfterDate(java.sql.Timestamp shipAfterDate)
Set ship after date for a particular ship groupvoid
setShipBeforeDate(int idx, java.sql.Timestamp shipBeforeDate)
Set ship before date for a particular ship groupvoid
setShipBeforeDate(java.sql.Timestamp shipBeforeDate)
Set ship before date for ship group 0void
setShipFromVendorPartyId(java.lang.String shipFromVendorPartyId)
void
setShipGroupFacilityId(int idx, java.lang.String facilityId)
void
setShipGroupSeqId(int idx, java.lang.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, java.lang.String vendorPartyId)
void
setShipmentMethodTypeId(int idx, java.lang.String shipmentMethodTypeId)
Sets the shipment method type.void
setShippingContactMechId(int idx, java.lang.String shippingContactMechId)
Sets the shipping contact mech id.void
setShippingInstructions(int idx, java.lang.String shippingInstructions)
Sets the shipping instructions.void
setShipToCustomerPartyId(java.lang.String shipToCustomerPartyId)
void
setSupplierAgentPartyId(java.lang.String supplierAgentPartyId)
void
setSupplierAgreementId(int idx, java.lang.String supplierAgreementId)
Sets the supplier agreement for the given ship group (drop shipment).void
setSupplierPartyId(int idx, java.lang.String supplierPartyId)
Sets the supplier for the given ship group (drop shipment).void
setTerminalId(java.lang.String terminalId)
void
setTransactionId(java.lang.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(java.lang.String webSiteId)
void
setWorkEffortId(java.lang.String workEffortId)
boolean
shippingApplies()
Returns true when there are shippable items in the cartint
size()
Returns the number of items in the cart object.boolean
taxApplies()
Returns true when there are taxable items in the cartboolean
viewCartOnAdd()
Returns true if the user wishes to view the cart everytime an item is added.
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
resource_error
public static final java.lang.String resource_error
- See Also:
- Constant Field Values
-
ALL
public static final int ALL
- See Also:
- Constant Field Values
-
EMPTY_ONLY
public static final int EMPTY_ONLY
- See Also:
- Constant Field Values
-
FILLED_ONLY
public static final int FILLED_ONLY
- See Also:
- Constant Field Values
-
scale
public static final int scale
-
rounding
public static final java.math.RoundingMode rounding
-
taxCalcScale
public static final int taxCalcScale
-
taxFinalScale
public static final int taxFinalScale
-
taxRounding
public static final java.math.RoundingMode taxRounding
-
generalRounding
public static final java.math.MathContext generalRounding
-
nextGroupNumber
protected long nextGroupNumber
-
paymentInfo
protected java.util.List<ShoppingCart.CartPaymentInfo> paymentInfo
-
productStoreId
protected java.lang.String productStoreId
-
doPromotions
protected boolean doPromotions
-
transactionId
protected java.lang.String transactionId
-
facilityId
protected java.lang.String facilityId
-
webSiteId
protected java.lang.String webSiteId
-
terminalId
protected java.lang.String terminalId
-
autoOrderShoppingListId
protected java.lang.String autoOrderShoppingListId
-
orderPartyId
protected java.lang.String orderPartyId
General partyId for the Order, all other IDs default to this one if not specified explicitly
-
placingCustomerPartyId
protected java.lang.String placingCustomerPartyId
-
billToCustomerPartyId
protected java.lang.String billToCustomerPartyId
-
shipToCustomerPartyId
protected java.lang.String shipToCustomerPartyId
-
endUserCustomerPartyId
protected java.lang.String endUserCustomerPartyId
-
billFromVendorPartyId
protected java.lang.String billFromVendorPartyId
-
shipFromVendorPartyId
protected java.lang.String shipFromVendorPartyId
-
supplierAgentPartyId
protected java.lang.String supplierAgentPartyId
-
userLogin
protected GenericValue userLogin
-
autoUserLogin
protected GenericValue autoUserLogin
-
locale
protected java.util.Locale locale
-
currencyUom
protected java.lang.String currencyUom
-
holdOrder
protected boolean holdOrder
-
orderDate
protected java.sql.Timestamp orderDate
-
cancelBackOrderDate
protected java.sql.Timestamp cancelBackOrderDate
-
-
Constructor Detail
-
ShoppingCart
protected ShoppingCart()
don't allow empty constructor
-
ShoppingCart
public ShoppingCart(ShoppingCart cart)
Creates a new cloned ShoppingCart Object.
-
ShoppingCart
public ShoppingCart(Delegator delegator, java.lang.String productStoreId, java.lang.String webSiteId, java.util.Locale locale, java.lang.String currencyUom, java.lang.String billToCustomerPartyId, java.lang.String billFromVendorPartyId)
Creates new empty ShoppingCart object.
-
ShoppingCart
public ShoppingCart(Delegator delegator, java.lang.String productStoreId, java.lang.String webSiteId, java.util.Locale locale, java.lang.String currencyUom)
Creates new empty ShoppingCart object.
-
ShoppingCart
public ShoppingCart(Delegator delegator, java.lang.String productStoreId, java.util.Locale locale, java.lang.String currencyUom)
Creates a new empty ShoppingCart object.
-
-
Method Detail
-
getDelegator
public Delegator getDelegator()
-
getProductStoreId
public java.lang.String getProductStoreId()
-
getDoPromotions
public boolean getDoPromotions()
-
setDoPromotions
public void setDoPromotions(boolean doPromotions)
-
setProductStoreId
public void setProductStoreId(java.lang.String productStoreId)
This is somewhat of a dangerous method, changing the productStoreId changes a lot of stuff including: - some items in the cart may not be valid in any catalog in the new store - promotions need to be recalculated for the products that remain - what else? lots of settings on the ProductStore... So for now this can only be called if the cart is empty... otherwise it wil throw an exception
-
getTransactionId
public java.lang.String getTransactionId()
-
setTransactionId
public void setTransactionId(java.lang.String transactionId)
-
getTerminalId
public java.lang.String getTerminalId()
-
setTerminalId
public void setTerminalId(java.lang.String terminalId)
-
getAutoOrderShoppingListId
public java.lang.String getAutoOrderShoppingListId()
-
setAutoOrderShoppingListId
public void setAutoOrderShoppingListId(java.lang.String autoOrderShoppingListId)
-
getFacilityId
public java.lang.String getFacilityId()
-
setFacilityId
public void setFacilityId(java.lang.String facilityId)
-
getLocale
public java.util.Locale getLocale()
-
setLocale
public void setLocale(java.util.Locale locale)
-
setOrderName
public void setOrderName(java.lang.String orderName)
-
getOrderName
public java.lang.String getOrderName()
-
setWorkEffortId
public void setWorkEffortId(java.lang.String workEffortId)
-
getWorkEffortId
public java.lang.String getWorkEffortId()
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)
-
removeAttribute
public void removeAttribute(java.lang.String name)
-
getAttribute
public <T> T getAttribute(java.lang.String name)
-
removeOrderAttribute
public void removeOrderAttribute(java.lang.String name)
-
setOrderAttribute
public void setOrderAttribute(java.lang.String name, java.lang.String value)
-
getOrderAttribute
public java.lang.String getOrderAttribute(java.lang.String name)
-
setHoldOrder
public void setHoldOrder(boolean b)
-
getHoldOrder
public boolean getHoldOrder()
-
setOrderDate
public void setOrderDate(java.sql.Timestamp t)
-
getOrderDate
public java.sql.Timestamp getOrderDate()
-
setCurrency
public void setCurrency(LocalDispatcher dispatcher, java.lang.String currencyUom) throws CartItemModifyException
Sets the currency for the cart.- Throws:
CartItemModifyException
-
getCurrency
public java.lang.String getCurrency()
Get the current currency setting.
-
getCartCreatedTime
public java.sql.Timestamp getCartCreatedTime()
-
getSupplierProduct
public GenericValue getSupplierProduct(java.lang.String productId, java.math.BigDecimal quantity, LocalDispatcher dispatcher)
-
addOrIncreaseItem
public int addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException
Add an item to the shopping cart, or if already there, increase the quantity.- Returns:
- the new/increased item index
- Throws:
CartItemModifyException
ItemNotFoundException
-
addOrIncreaseItem
public int addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException
add rental (with accommodation) item to cart
-
addOrIncreaseItem
public int addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,java.lang.String> orderItemAttributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException
add rental (with accommodation) item to cart and order item attributes
-
addOrIncreaseItem
public int addOrIncreaseItem(java.lang.String productId, java.math.BigDecimal selectedAmount, java.math.BigDecimal quantity, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.sql.Timestamp shipBeforeDate, java.sql.Timestamp shipAfterDate, java.sql.Timestamp reserveAfterDate, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.util.Map<java.lang.String,java.lang.String> orderItemAttributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, java.lang.String itemGroupNumber, java.lang.String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException
add rental (with accommodation) item to cart and order item attributes
-
addNonProductItem
public int addNonProductItem(java.lang.String itemType, java.lang.String description, java.lang.String categoryId, java.math.BigDecimal price, java.math.BigDecimal quantity, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemGroupNumber, LocalDispatcher dispatcher) throws CartItemModifyException
Add a non-product item to the shopping cart.- Returns:
- the new item index
- Throws:
CartItemModifyException
-
addItem
public int addItem(int index, ShoppingCartItem item) throws CartItemModifyException
Add an item to the shopping cart.- Throws:
CartItemModifyException
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, ProductConfigWrapper configWrapper, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException
Add an item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException
Add an item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException
Add an (rental)item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
Add an (rental)item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
Add an (rental/aggregated)item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException
Add an accommodation(rental)item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersons, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
Add an accommodation(rental)item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.sql.Timestamp reservStart, java.math.BigDecimal reservLength, java.math.BigDecimal reservPersonsDbl, java.lang.String accommodationMapId, java.lang.String accommodationSpotId, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, ProductConfigWrapper configWrapper, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
Add an accommodation(rental/aggregated)item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(java.lang.String productId, java.math.BigDecimal amount, java.math.BigDecimal quantity, java.math.BigDecimal unitPrice, java.util.HashMap<java.lang.String,GenericValue> features, java.util.HashMap<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.lang.String itemType, LocalDispatcher dispatcher, java.lang.Boolean triggerExternalOps, java.lang.Boolean triggerPriceRules, java.lang.Boolean skipInventoryChecks, java.lang.Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException
Add an item to the shopping cart.
-
addItemToEnd
public int addItemToEnd(ShoppingCartItem item) throws CartItemModifyException
Add an item to the shopping cart.- Throws:
CartItemModifyException
-
findCartItem
public ShoppingCartItem findCartItem(java.lang.String productId, java.util.Map<java.lang.String,GenericValue> features, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String prodCatalogId, java.math.BigDecimal selectedAmount)
Get a ShoppingCartItem from the cart object.
-
findAllCartItems
public java.util.List<ShoppingCartItem> findAllCartItems(java.lang.String productId)
Get all ShoppingCartItems from the cart object with the given productId.
-
findAllCartItems
public java.util.List<ShoppingCartItem> findAllCartItems(java.lang.String productId, java.lang.String groupNumber)
Get all ShoppingCartItems from the cart object with the given productId and optional groupNumber to limit it to a specific item group
-
findAllCartItemsInCategory
public java.util.List<ShoppingCartItem> findAllCartItemsInCategory(java.lang.String productCategoryId, java.lang.String groupNumber)
Get all ShoppingCartItems from the cart object with the given productCategoryId and optional groupNumber to limit it to a specific item group
-
removeEmptyCartItems
public void removeEmptyCartItems()
Remove quantity 0 ShoppingCartItems from the cart object.
-
removeExtraItems
public void removeExtraItems(java.util.List<ShoppingCartItem> multipleItems, LocalDispatcher dispatcher, int maxItems) throws CartItemModifyException
- Throws:
CartItemModifyException
-
getItemsTotalQuantity
public static java.math.BigDecimal getItemsTotalQuantity(java.util.List<ShoppingCartItem> cartItems)
-
getItemsProducts
public static java.util.List<GenericValue> getItemsProducts(java.util.List<ShoppingCartItem> cartItems)
-
ensureItemsQuantity
public void ensureItemsQuantity(java.util.List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, java.math.BigDecimal quantity) throws CartItemModifyException
- Throws:
CartItemModifyException
-
ensureItemsTotalQuantity
public java.math.BigDecimal ensureItemsTotalQuantity(java.util.List<ShoppingCartItem> cartItems, LocalDispatcher dispatcher, java.math.BigDecimal quantity) throws CartItemModifyException
- Throws:
CartItemModifyException
-
containAnyWorkEffortCartItems
public boolean containAnyWorkEffortCartItems()
-
containAllWorkEffortCartItems
public boolean containAllWorkEffortCartItems()
-
containOnlyDigitalGoods
public boolean containOnlyDigitalGoods()
Check to see if the cart contains only Digital Goods, ie no Finished Goods and no Finished/Digital Goods, et cetera. This is determined by making sure no Product has a type where ProductType.isPhysical!=N.
-
containOnlyDigitalGoods
public boolean containOnlyDigitalGoods(int shipGroupIdx)
Check to see if the ship group contains only Digital Goods, ie no Finished Goods and no Finished/Digital Goods, et cetera. This is determined by making sure no Product has a type where ProductType.isPhysical!=N.
-
getItemIndex
public int getItemIndex(ShoppingCartItem item)
Returns this item's index.
-
findCartItem
public ShoppingCartItem findCartItem(int index)
Get a ShoppingCartItem from the cart object.
-
findCartItem
public ShoppingCartItem findCartItem(java.lang.String orderItemSeqId)
-
removeCartItem
public void removeCartItem(ShoppingCartItem item, LocalDispatcher dispatcher) throws CartItemModifyException
- Throws:
CartItemModifyException
-
removeCartItem
public void removeCartItem(int index, LocalDispatcher dispatcher) throws CartItemModifyException
Remove an item from the cart object.- Throws:
CartItemModifyException
-
moveCartItem
public void moveCartItem(int fromIndex, int toIndex)
Moves a line item to a different index.
-
size
public int size()
Returns the number of items in the cart object.
-
items
public java.util.List<ShoppingCartItem> items()
Returns a Collection of items in the cart object.
-
iterator
public java.util.Iterator<ShoppingCartItem> iterator()
Returns an iterator of cart items.- Specified by:
iterator
in interfacejava.lang.Iterable<ShoppingCartItem>
-
getItemGroupByNumber
public ShoppingCart.ShoppingCartItemGroup getItemGroupByNumber(java.lang.String groupNumber)
-
addItemGroup
public java.lang.String addItemGroup(java.lang.String groupName, java.lang.String parentGroupNumber)
Creates a new Item Group and returns the groupNumber that represents it
-
addItemGroup
public ShoppingCart.ShoppingCartItemGroup addItemGroup(GenericValue itemGroupValue) throws GenericEntityException
- Throws:
GenericEntityException
-
getCartItemsInNoGroup
public java.util.List<ShoppingCartItem> getCartItemsInNoGroup()
-
getCartItemsInGroup
public java.util.List<ShoppingCartItem> getCartItemsInGroup(java.lang.String groupNumber)
-
deleteItemGroup
public void deleteItemGroup(java.lang.String groupNumber)
-
getUserLogin
public GenericValue getUserLogin()
Gets the userLogin associated with the cart; may be null
-
setUserLogin
public void setUserLogin(GenericValue userLogin, LocalDispatcher dispatcher) throws CartItemModifyException
- Throws:
CartItemModifyException
-
setUserLogin
protected void setUserLogin(GenericValue userLogin)
-
getAutoUserLogin
public GenericValue getAutoUserLogin()
-
setAutoUserLogin
public void setAutoUserLogin(GenericValue autoUserLogin, LocalDispatcher dispatcher) throws CartItemModifyException
- Throws:
CartItemModifyException
-
setAutoUserLogin
protected void setAutoUserLogin(GenericValue autoUserLogin)
-
handleNewUser
public void handleNewUser(LocalDispatcher dispatcher) throws CartItemModifyException
- Throws:
CartItemModifyException
-
getExternalId
public java.lang.String getExternalId()
-
setExternalId
public void setExternalId(java.lang.String externalId)
-
getInternalCode
public java.lang.String getInternalCode()
-
setInternalCode
public void setInternalCode(java.lang.String internalCode)
-
getWebSiteId
public java.lang.String getWebSiteId()
-
setWebSiteId
public void setWebSiteId(java.lang.String webSiteId)
-
setShipBeforeDate
public void setShipBeforeDate(int idx, java.sql.Timestamp shipBeforeDate)
Set ship before date for a particular ship group- Parameters:
idx
-shipBeforeDate
-
-
setShipBeforeDate
public void setShipBeforeDate(java.sql.Timestamp shipBeforeDate)
Set ship before date for ship group 0- Parameters:
shipBeforeDate
-
-
getShipBeforeDate
public java.sql.Timestamp getShipBeforeDate(int idx)
Get ship before date for a particular ship group- Parameters:
idx
- the ship group number- Returns:
- ship before date for a given ship group
-
getShipBeforeDate
public java.sql.Timestamp getShipBeforeDate()
Get ship before date for ship group 0- Returns:
- ship before date for the first ship group
-
setShipAfterDate
public void setShipAfterDate(int idx, java.sql.Timestamp shipAfterDate)
Set ship after date for a particular ship group- Parameters:
idx
- the ship group numbershipAfterDate
- the ship after date to be set for the given ship group
-
setShipAfterDate
public void setShipAfterDate(java.sql.Timestamp shipAfterDate)
Set ship after date for a particular ship group- Parameters:
shipAfterDate
- the ship after date to be set for the first ship group
-
getShipAfterDate
public java.sql.Timestamp getShipAfterDate(int idx)
Get ship after date for a particular ship group- Parameters:
idx
- the ship group number- Returns:
- return the ship after date for the given ship group
-
getShipAfterDate
public java.sql.Timestamp getShipAfterDate()
Get ship after date for ship group 0- Returns:
- return the ship after date for the first ship group
-
setDefaultShipBeforeDate
public void setDefaultShipBeforeDate(java.sql.Timestamp defaultShipBeforeDate)
-
getDefaultShipBeforeDate
public java.sql.Timestamp getDefaultShipBeforeDate()
-
setDefaultShipAfterDate
public void setDefaultShipAfterDate(java.sql.Timestamp defaultShipAfterDate)
-
setCancelBackOrderDate
public void setCancelBackOrderDate(java.sql.Timestamp cancelBackOrderDate)
-
getCancelBackOrderDate
public java.sql.Timestamp getCancelBackOrderDate()
-
getDefaultShipAfterDate
public java.sql.Timestamp getDefaultShipAfterDate()
-
setDefaultReserveAfterDate
public void setDefaultReserveAfterDate(java.sql.Timestamp defaultReserveAfterDate)
-
getDefaultReserveAfterDate
public java.sql.Timestamp getDefaultReserveAfterDate()
-
getOrderPartyId
public java.lang.String getOrderPartyId()
-
setOrderPartyId
public void setOrderPartyId(java.lang.String orderPartyId)
-
getPlacingCustomerPartyId
public java.lang.String getPlacingCustomerPartyId()
-
setPlacingCustomerPartyId
public void setPlacingCustomerPartyId(java.lang.String placingCustomerPartyId)
-
getBillToCustomerPartyId
public java.lang.String getBillToCustomerPartyId()
-
setBillToCustomerPartyId
public void setBillToCustomerPartyId(java.lang.String billToCustomerPartyId)
-
getShipToCustomerPartyId
public java.lang.String getShipToCustomerPartyId()
-
setShipToCustomerPartyId
public void setShipToCustomerPartyId(java.lang.String shipToCustomerPartyId)
-
getEndUserCustomerPartyId
public java.lang.String getEndUserCustomerPartyId()
-
setEndUserCustomerPartyId
public void setEndUserCustomerPartyId(java.lang.String endUserCustomerPartyId)
-
getBillFromVendorPartyId
public java.lang.String getBillFromVendorPartyId()
-
setBillFromVendorPartyId
public void setBillFromVendorPartyId(java.lang.String billFromVendorPartyId)
-
getShipFromVendorPartyId
public java.lang.String getShipFromVendorPartyId()
-
setShipFromVendorPartyId
public void setShipFromVendorPartyId(java.lang.String shipFromVendorPartyId)
-
getSupplierAgentPartyId
public java.lang.String getSupplierAgentPartyId()
-
setSupplierAgentPartyId
public void setSupplierAgentPartyId(java.lang.String supplierAgentPartyId)
-
getPartyId
public java.lang.String getPartyId()
-
setAutoSaveListId
public void setAutoSaveListId(java.lang.String id)
-
getAutoSaveListId
public java.lang.String getAutoSaveListId()
-
setLastListRestore
public void setLastListRestore(java.sql.Timestamp time)
-
getLastListRestore
public java.sql.Timestamp getLastListRestore()
-
getPartyDaysSinceCreated
public java.math.BigDecimal getPartyDaysSinceCreated(java.sql.Timestamp nowTimestamp)
-
clear
public void clear()
Clears out the cart.
-
setOrderType
public void setOrderType(java.lang.String orderType)
Sets the order type.
-
getOrderType
public java.lang.String getOrderType()
Returns the order type.
-
setChannelType
public void setChannelType(java.lang.String channelType)
-
getChannelType
public java.lang.String getChannelType()
-
isPurchaseOrder
public boolean isPurchaseOrder()
-
isSalesOrder
public boolean isSalesOrder()
-
setPoNumber
public void setPoNumber(java.lang.String poNumber)
Sets the PO Number in the cart.
-
getPoNumber
public java.lang.String getPoNumber()
Returns the po number.
-
setDefaultItemDeliveryDate
public void setDefaultItemDeliveryDate(java.lang.String date)
-
getDefaultItemDeliveryDate
public java.lang.String getDefaultItemDeliveryDate()
-
setDefaultItemComment
public void setDefaultItemComment(java.lang.String comment)
-
getDefaultItemComment
public java.lang.String getDefaultItemComment()
-
setAgreementId
public void setAgreementId(java.lang.String agreementId)
-
getAgreementId
public java.lang.String getAgreementId()
-
setQuoteId
public void setQuoteId(java.lang.String quoteId)
-
getQuoteId
public java.lang.String getQuoteId()
-
getPaymentMethodTypeId
public java.lang.String getPaymentMethodTypeId(java.lang.String paymentMethodId)
-
makePaymentInfo
public ShoppingCart.CartPaymentInfo makePaymentInfo(java.lang.String id, java.lang.String refNum, java.math.BigDecimal amount)
Creates a CartPaymentInfo object
-
makePaymentInfo
public ShoppingCart.CartPaymentInfo makePaymentInfo(java.lang.String id, java.lang.String refNum, java.lang.String authCode, java.math.BigDecimal amount)
Creates a CartPaymentInfo object with a possible authCode (may be null)
-
getPaymentInfoIndex
public int getPaymentInfoIndex(java.lang.String id, java.lang.String refNum)
Locates the index of an existing CartPaymentInfo object or -1 if none found
-
getPaymentInfos
public java.util.List<ShoppingCart.CartPaymentInfo> getPaymentInfos(boolean isPaymentMethod, boolean isPaymentMethodType, boolean hasRefNum)
Returns the CartPaymentInfo objects which have matching fields
-
getPaymentInfo
public ShoppingCart.CartPaymentInfo getPaymentInfo(int index)
Locates an existing CartPaymentInfo object by index
-
getPaymentInfo
public ShoppingCart.CartPaymentInfo getPaymentInfo(java.lang.String id, java.lang.String refNum, java.lang.String authCode, java.math.BigDecimal amount, boolean update)
Locates an existing (or creates a new) CartPaymentInfo object
-
getPaymentInfo
public ShoppingCart.CartPaymentInfo getPaymentInfo(java.lang.String id, java.lang.String refNum, java.lang.String authCode, java.math.BigDecimal amount)
Locates an existing (or creates a new) CartPaymentInfo object
-
getPaymentInfo
public ShoppingCart.CartPaymentInfo getPaymentInfo(java.lang.String id)
Locates an existing (or creates a new) CartPaymentInfo object
-
addPaymentAmount
public ShoppingCart.CartPaymentInfo addPaymentAmount(java.lang.String id, java.math.BigDecimal amount, java.lang.String refNum, java.lang.String authCode, boolean isSingleUse, boolean isPresent, boolean replace)
adds a payment method/payment method type
-
addPaymentAmount
public ShoppingCart.CartPaymentInfo addPaymentAmount(java.lang.String id, java.math.BigDecimal amount, boolean isSingleUse)
adds a payment method/payment method type
-
addPaymentAmount
public ShoppingCart.CartPaymentInfo addPaymentAmount(java.lang.String id, java.math.BigDecimal amount)
adds a payment method/payment method type
-
addPayment
public ShoppingCart.CartPaymentInfo addPayment(java.lang.String id)
adds a payment method/payment method type
-
getPaymentAmount
public java.math.BigDecimal getPaymentAmount(java.lang.String id)
returns the payment method/payment method type amount
-
addPaymentRef
public void addPaymentRef(java.lang.String id, java.lang.String ref, java.lang.String authCode)
-
getPaymentRef
public java.lang.String getPaymentRef(java.lang.String id)
-
getPaymentTotal
public java.math.BigDecimal getPaymentTotal()
returns the total payment amounts
-
selectedPayments
public int selectedPayments()
-
isPaymentSelected
public boolean isPaymentSelected(java.lang.String id)
-
clearPayment
public void clearPayment(java.lang.String id)
removes a specific payment method/payment method type
-
clearPayment
public void clearPayment(int index)
removes a specific payment info from the list
-
clearPayments
public void clearPayments()
clears all payment method/payment method types
-
clearPaymentMethodsById
public void clearPaymentMethodsById(java.util.List<java.lang.String> paymentMethodIdsToRemove)
remove all the paymentMethods based on the paymentMethodIds
-
clearDeclinedPaymentMethods
public void clearDeclinedPaymentMethods(Delegator delegator)
remove declined payment methods for an order from cart. The idea is to call this after an attempted order is rejected
-
getPaymentMethodIds
public java.util.List<java.lang.String> getPaymentMethodIds()
Returns the Payment Method Ids
-
getPaymentMethodTypeIds
public java.util.List<java.lang.String> getPaymentMethodTypeIds()
Returns the Payment Method Type Ids
-
getPaymentMethods
public java.util.List<GenericValue> getPaymentMethods()
Returns a list of PaymentMethod value objects selected in the cart
-
getPaymentMethodTypes
public java.util.List<GenericValue> getPaymentMethodTypes()
Returns a list of PaymentMethodType value objects selected in the cart
-
getCreditCards
public java.util.List<GenericValue> getCreditCards()
-
getGiftCards
public java.util.List<GenericValue> getGiftCards()
-
isPaymentMethodType
public boolean isPaymentMethodType(java.lang.String id)
-
getBillingAddress
public GenericValue getBillingAddress()
-
getGiftCertSettingFromStore
public GenericValue getGiftCertSettingFromStore(Delegator delegator) throws GenericEntityException
Returns ProductStoreFinActSetting based on cart's productStoreId and FinAccountHelper's defined giftCertFinAcctTypeId- Parameters:
delegator
- the delegator- Returns:
- returns ProductStoreFinActSetting based on cart's productStoreId
- Throws:
GenericEntityException
-
isPinRequiredForGC
public boolean isPinRequiredForGC(Delegator delegator)
Determines whether pin numbers are required for gift cards, based on ProductStoreFinActSetting. Default to true.- Parameters:
delegator
- the delegator- Returns:
- returns true whether pin numbers are required for gift card
-
isValidateGCFinAccount
public boolean isValidateGCFinAccount(Delegator delegator)
Returns whether the cart should validate gift cards against FinAccount (ie, internal gift certificates). Defaults to false.- Parameters:
delegator
- the delegator- Returns:
- returns true whether the cart should validate gift cards against FinAccount
-
setBillingAccount
public void setBillingAccount(java.lang.String billingAccountId, java.math.BigDecimal amount)
Sets the billing account id string.
-
getBillingAccountId
public java.lang.String getBillingAccountId()
Returns the billing message string.
-
getBillingAccountAmount
public java.math.BigDecimal getBillingAccountAmount()
Returns the amount to be billed to the billing account.
-
getOrderShipping
public java.math.BigDecimal getOrderShipping()
Returns the order level shipping amount
-
addShipInfo
public int addShipInfo()
-
getShipGroups
public java.util.List<ShoppingCart.CartShipInfo> getShipGroups()
-
getShipGroups
public java.util.Map<java.lang.Integer,java.math.BigDecimal> getShipGroups(ShoppingCartItem item)
-
getShipGroups
public java.util.Map<java.lang.Integer,java.math.BigDecimal> getShipGroups(int itemIndex)
-
getShipInfo
public ShoppingCart.CartShipInfo getShipInfo(int idx)
-
getShipGroupSize
public int getShipGroupSize()
-
getShipGroupItems
public java.util.Map<ShoppingCartItem,java.math.BigDecimal> getShipGroupItems(int idx)
Returns the ShoppingCartItem (key) and quantity (value) associated with the ship group
-
clearItemShipInfo
public void clearItemShipInfo(ShoppingCartItem item)
-
setItemShipGroupEstimate
public void setItemShipGroupEstimate(java.math.BigDecimal amount, int idx)
-
setShipGroupShipDatesFromItem
public void setShipGroupShipDatesFromItem(ShoppingCartItem item)
Updates the shipBefore and shipAfterDates of all ship groups that the item belongs to, re-setting ship group ship before date if item ship before date is before it and ship group ship after date if item ship after date is before it.- Parameters:
item
-
-
getItemShipGroupEstimate
public java.math.BigDecimal getItemShipGroupEstimate(int idx)
-
setItemShipGroupQty
public void setItemShipGroupQty(int itemIndex, java.math.BigDecimal quantity, int idx)
-
setItemShipGroupQty
public void setItemShipGroupQty(ShoppingCartItem item, java.math.BigDecimal quantity, int idx)
-
setItemShipGroupQty
public void setItemShipGroupQty(ShoppingCartItem item, int itemIndex, java.math.BigDecimal quantity, int idx)
-
getItemShipGroupQty
public java.math.BigDecimal getItemShipGroupQty(ShoppingCartItem item, int idx)
-
getItemShipGroupQty
public java.math.BigDecimal getItemShipGroupQty(int itemIndex, int idx)
-
positionItemToGroup
public void positionItemToGroup(int itemIndex, java.math.BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
-
positionItemToGroup
public void positionItemToGroup(ShoppingCartItem item, java.math.BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups)
-
checkShipItemInfo
protected boolean checkShipItemInfo(ShoppingCart.CartShipInfo csi, ShoppingCart.CartShipInfo.CartShipItemInfo csii)
-
cleanUpShipGroups
public void cleanUpShipGroups()
-
getShipInfoIndex
public int getShipInfoIndex(java.lang.String shipGroupSeqId)
-
getItemShipGroupIndex
public int getItemShipGroupIndex(int itemId)
Return index of the ship group where the item is located- Returns:
-
setShippingContactMechId
public void setShippingContactMechId(int idx, java.lang.String shippingContactMechId)
Sets the shipping contact mech id.
-
setAllShippingContactMechId
public void setAllShippingContactMechId(java.lang.String shippingContactMechId)
Sets @param shippingContactMechId in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
shippingContactMechId
-
-
getShippingContactMechId
public java.lang.String getShippingContactMechId(int idx)
Returns the shipping contact mech id.
-
getShippingContactMechId
public java.lang.String getShippingContactMechId()
-
setShipmentMethodTypeId
public void setShipmentMethodTypeId(int idx, java.lang.String shipmentMethodTypeId)
Sets the shipment method type.
-
setAllShipmentMethodTypeId
public void setAllShipmentMethodTypeId(java.lang.String shipmentMethodTypeId)
Sets @param shipmentMethodTypeId in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
shipmentMethodTypeId
-
-
getShipmentMethodTypeId
public java.lang.String getShipmentMethodTypeId(int idx)
Returns the shipment method type ID
-
getShipmentMethodTypeId
public java.lang.String getShipmentMethodTypeId()
-
getShipmentMethodType
public GenericValue getShipmentMethodType(int idx)
Returns the shipment method type.
-
setSupplierPartyId
public void setSupplierPartyId(int idx, java.lang.String supplierPartyId)
Sets the supplier for the given ship group (drop shipment).
-
getSupplierPartyId
public java.lang.String getSupplierPartyId(int idx)
Returns the supplier for the given ship group (drop shipment).
-
setSupplierAgreementId
public void setSupplierAgreementId(int idx, java.lang.String supplierAgreementId)
Sets the supplier agreement for the given ship group (drop shipment).
-
getSupplierAgreementId
public java.lang.String getSupplierAgreementId(int idx)
Returns the supplier Agreement for the given ship group (drop shipment).
-
setShippingInstructions
public void setShippingInstructions(int idx, java.lang.String shippingInstructions)
Sets the shipping instructions.
-
setAllShippingInstructions
public void setAllShippingInstructions(java.lang.String shippingInstructions)
Sets @param shippingInstructions in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
shippingInstructions
-
-
getShippingInstructions
public java.lang.String getShippingInstructions(int idx)
Returns the shipping instructions.
-
getShippingInstructions
public java.lang.String getShippingInstructions()
-
setMaySplit
public void setMaySplit(int idx, java.lang.Boolean maySplit)
-
setAllMaySplit
public void setAllMaySplit(java.lang.Boolean maySplit)
Sets @param maySplit in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
maySplit
-
-
getMaySplit
public java.lang.String getMaySplit(int idx)
Returns Boolean.TRUE if the order may be split (null if unspecified)
-
getMaySplit
public java.lang.String getMaySplit()
-
setGiftMessage
public void setGiftMessage(int idx, java.lang.String giftMessage)
-
setAllGiftMessage
public void setAllGiftMessage(java.lang.String giftMessage)
Sets @param giftMessage in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
giftMessage
-
-
getGiftMessage
public java.lang.String getGiftMessage(int idx)
-
getGiftMessage
public java.lang.String getGiftMessage()
-
setIsGift
public void setIsGift(int idx, java.lang.Boolean isGift)
-
setAllIsGift
public void setAllIsGift(java.lang.Boolean isGift)
Sets @param isGift in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
isGift
-
-
getIsGift
public java.lang.String getIsGift(int idx)
-
getIsGift
public java.lang.String getIsGift()
-
setCarrierPartyId
public void setCarrierPartyId(int idx, java.lang.String carrierPartyId)
-
setAllCarrierPartyId
public void setAllCarrierPartyId(java.lang.String carrierPartyId)
Sets @param carrierPartyId in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
carrierPartyId
-
-
getCarrierPartyId
public java.lang.String getCarrierPartyId(int idx)
-
getCarrierPartyId
public java.lang.String getCarrierPartyId()
-
getProductStoreShipMethId
public java.lang.String getProductStoreShipMethId(int idx)
-
getProductStoreShipMethId
public java.lang.String getProductStoreShipMethId()
-
setProductStoreShipMethId
public void setProductStoreShipMethId(int idx, java.lang.String productStoreShipMethId)
-
setAllProductStoreShipMethId
public void setAllProductStoreShipMethId(java.lang.String productStoreShipMethId)
Sets @param productStoreShipMethId in all ShipInfo(ShipGroups) associated with this ShoppingCart- Parameters:
productStoreShipMethId
-
-
setShipGroupFacilityId
public void setShipGroupFacilityId(int idx, java.lang.String facilityId)
-
getShipGroupFacilityId
public java.lang.String getShipGroupFacilityId(int idx)
-
setShipGroupVendorPartyId
public void setShipGroupVendorPartyId(int idx, java.lang.String vendorPartyId)
-
getShipGroupVendorPartyId
public java.lang.String getShipGroupVendorPartyId(int idx)
-
setShipGroupSeqId
public void setShipGroupSeqId(int idx, java.lang.String shipGroupSeqId)
-
getShipGroupSeqId
public java.lang.String getShipGroupSeqId(int idx)
-
setOrderAdditionalEmails
public void setOrderAdditionalEmails(java.lang.String orderAdditionalEmails)
-
getOrderAdditionalEmails
public java.lang.String getOrderAdditionalEmails()
-
getShippingAddress
public GenericValue getShippingAddress(int idx)
-
getOriginAddress
public GenericValue getOriginAddress(int idx)
-
getShippingAddress
public GenericValue getShippingAddress()
-
getInternalOrderNotes
public java.util.List<java.lang.String> getInternalOrderNotes()
-
getOrderNotes
public java.util.List<java.lang.String> getOrderNotes()
-
addInternalOrderNote
public void addInternalOrderNote(java.lang.String note)
-
clearInternalOrderNotes
public void clearInternalOrderNotes()
-
clearOrderNotes
public void clearOrderNotes()
-
addOrderNote
public void addOrderNote(java.lang.String note)
-
setDefaultCheckoutOptions
public void setDefaultCheckoutOptions(LocalDispatcher dispatcher)
-
getTotalSalesTax
public java.math.BigDecimal getTotalSalesTax(int shipGroup)
-
getTotalSalesTax
public java.math.BigDecimal getTotalSalesTax()
Returns the tax amount from the cart object.
-
getTotalShipping
public java.math.BigDecimal getTotalShipping()
Returns the shipping amount from the cart object.
-
getItemTotal
public java.math.BigDecimal getItemTotal()
Returns the item-total in the cart (not including discount/tax/shipping).
-
getSubTotal
public java.math.BigDecimal getSubTotal()
Returns the sub-total in the cart (item-total - discount).
-
getGrandTotal
public java.math.BigDecimal getGrandTotal()
Returns the total from the cart, including tax/shipping.
-
getDisplaySubTotal
public java.math.BigDecimal getDisplaySubTotal()
-
getOrderGlobalAdjustments
public java.math.BigDecimal getOrderGlobalAdjustments()
-
getDisplayTaxIncluded
public java.math.BigDecimal getDisplayTaxIncluded()
-
getDisplayRecurringSubTotal
public java.math.BigDecimal getDisplayRecurringSubTotal()
-
getDisplayGrandTotal
public java.math.BigDecimal getDisplayGrandTotal()
Returns the total from the cart, including tax/shipping.
-
getOrderOtherAdjustmentTotal
public java.math.BigDecimal getOrderOtherAdjustmentTotal()
-
getSubTotalForPromotions
public java.math.BigDecimal getSubTotalForPromotions()
Returns the sub-total in the cart (item-total - discount).
-
getSubTotalForPromotions
public java.math.BigDecimal getSubTotalForPromotions(java.util.Set<java.lang.String> productIds)
-
getOrderPaymentPreferenceTotalByType
public java.math.BigDecimal getOrderPaymentPreferenceTotalByType(java.lang.String paymentMethodTypeId)
Get the total payment amount by payment type. Specify null to get amount over all types.
-
getCreditCardPaymentPreferenceTotal
public java.math.BigDecimal getCreditCardPaymentPreferenceTotal()
-
getBillingAccountPaymentPreferenceTotal
public java.math.BigDecimal getBillingAccountPaymentPreferenceTotal()
-
getGiftCardPaymentPreferenceTotal
public java.math.BigDecimal getGiftCardPaymentPreferenceTotal()
-
addContactMech
public void addContactMech(java.lang.String contactMechPurposeTypeId, java.lang.String contactMechId)
Add a contact mech to this purpose; the contactMechPurposeTypeId is required
-
getContactMech
public java.lang.String getContactMech(java.lang.String contactMechPurposeTypeId)
Get the contactMechId for this cart given the contactMechPurposeTypeId
-
removeContactMech
public java.lang.String removeContactMech(java.lang.String contactMechPurposeTypeId)
Remove the contactMechId from this cart given the contactMechPurposeTypeId
-
getOrderContactMechIds
public java.util.Map<java.lang.String,java.lang.String> getOrderContactMechIds()
-
getAdjustments
public java.util.List<GenericValue> getAdjustments()
Get a List of adjustments on the order (ie cart)
-
getAdjustmentPromoIndex
public int getAdjustmentPromoIndex(java.lang.String productPromoId)
-
addAdjustment
public int addAdjustment(GenericValue adjustment)
Add an adjustment to the order; don't worry about setting the orderId, orderItemSeqId or orderAdjustmentId; they will be set when the order is created
-
removeAdjustment
public void removeAdjustment(int index)
-
getAdjustment
public GenericValue getAdjustment(int index)
-
getOrderTerms
public java.util.List<GenericValue> getOrderTerms()
Get a List of orderTerms on the order (ie cart)
-
addOrderTerm
public int addOrderTerm(java.lang.String termTypeId, java.math.BigDecimal termValue, java.lang.Long termDays)
Add an orderTerm to the order
-
addOrderTerm
public int addOrderTerm(java.lang.String termTypeId, java.math.BigDecimal termValue, java.lang.Long termDays, java.lang.String textValue)
Add an orderTerm to the order
-
addOrderTerm
public int addOrderTerm(java.lang.String termTypeId, java.lang.String orderItemSeqId, java.math.BigDecimal termValue, java.lang.Long termDays, java.lang.String textValue, java.lang.String description)
-
addOrderTerm
public int addOrderTerm(GenericValue orderTerm)
Add an orderTerm to the order
-
removeOrderTerm
public void removeOrderTerm(int index)
-
removeOrderTerms
public void removeOrderTerms()
-
isOrderTermSet
public boolean isOrderTermSet()
-
setOrderTermSet
public void setOrderTermSet(boolean orderTermSet)
-
hasOrderTerm
public boolean hasOrderTerm(java.lang.String termTypeId)
-
isReadOnlyCart
public boolean isReadOnlyCart()
-
setReadOnlyCart
public void setReadOnlyCart(boolean readOnlyCart)
-
removeAdjustmentByType
public void removeAdjustmentByType(java.lang.String orderAdjustmentTypeId)
go through the order adjustments and remove all adjustments with the given type
-
getTotalWeight
public java.math.BigDecimal getTotalWeight()
Returns the total weight in the cart.
-
getTotalQuantity
public java.math.BigDecimal getTotalQuantity()
Returns the total quantity in the cart.
-
getShippableTotal
public java.math.BigDecimal getShippableTotal(int idx)
Returns the SHIPPABLE item-total in the cart for a specific ship group.
-
getShippableQuantity
public java.math.BigDecimal getShippableQuantity(int idx)
Returns the total SHIPPABLE quantity in the cart for a specific ship group.
-
getShippableWeight
public java.math.BigDecimal getShippableWeight(int idx)
Returns the total SHIPPABLE weight in the cart for a specific ship group.
-
getShippableSizes
public java.util.List<java.math.BigDecimal> getShippableSizes(int idx)
Returns a List of shippable item's size for a specific ship group.
-
getShippableItemInfo
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getShippableItemInfo(int idx)
Returns a List of shippable item info (quantity, size, weight) for a specific ship group
-
shippingApplies
public boolean shippingApplies()
Returns true when there are shippable items in the cart
-
taxApplies
public boolean taxApplies()
Returns true when there are taxable items in the cart
-
getFeatureIdQtyMap
public java.util.Map<java.lang.String,java.math.BigDecimal> getFeatureIdQtyMap(int idx)
Returns a Map of all features applied to products in the cart with quantities for a specific ship group.
-
viewCartOnAdd
public boolean viewCartOnAdd()
Returns true if the user wishes to view the cart everytime an item is added.
-
setViewCartOnAdd
public void setViewCartOnAdd(boolean viewCartOnAdd)
Returns true if the user wishes to view the cart everytime an item is added.
-
getOrderId
public java.lang.String getOrderId()
Returns the order ID associated with this cart or null if no order has been created yet.
-
getFirstAttemptOrderId
public java.lang.String getFirstAttemptOrderId()
Returns the first attempt order ID associated with this cart or null if no order has been created yet.
-
setOrderId
public void setOrderId(java.lang.String orderId)
Sets the orderId associated with this cart.
-
setNextItemSeq
public void setNextItemSeq(long seq) throws GeneralException
- Throws:
GeneralException
-
setFirstAttemptOrderId
public void setFirstAttemptOrderId(java.lang.String orderId)
TODO: Sets the first attempt orderId for this cart.
-
removeAllFreeShippingProductPromoActions
public void removeAllFreeShippingProductPromoActions()
-
removeFreeShippingProductPromoAction
public void removeFreeShippingProductPromoAction(GenericPK productPromoActionPK)
Removes a free shipping ProductPromoAction by trying to find one in the list with the same primary key.
-
addFreeShippingProductPromoAction
public void addFreeShippingProductPromoAction(GenericValue productPromoAction)
Adds a ProductPromoAction to be used for free shipping (must be of type free shipping, or nothing will be done).
-
getFreeShippingProductPromoActions
public java.util.List<GenericValue> getFreeShippingProductPromoActions()
-
removeAllDesiredAlternateGiftByActions
public void removeAllDesiredAlternateGiftByActions()
-
setDesiredAlternateGiftByAction
public void setDesiredAlternateGiftByAction(GenericPK productPromoActionPK, java.lang.String productId)
-
getDesiredAlternateGiftByAction
public java.lang.String getDesiredAlternateGiftByAction(GenericPK productPromoActionPK)
-
getAllDesiredAlternateGiftByActionCopy
public java.util.Map<GenericPK,java.lang.String> getAllDesiredAlternateGiftByActionCopy()
-
addProductPromoUse
public void addProductPromoUse(java.lang.String productPromoId, java.lang.String productPromoCodeId, java.math.BigDecimal totalDiscountAmount, java.math.BigDecimal quantityLeftInActions, java.util.Map<ShoppingCartItem,java.math.BigDecimal> usageInfoMap)
-
removeProductPromoUse
public void removeProductPromoUse(java.lang.String productPromoId)
-
clearProductPromoUseInfo
public void clearProductPromoUseInfo()
-
clearCartItemUseInPromoInfo
public void clearCartItemUseInPromoInfo()
-
getProductPromoUseInfoIter
public java.util.Iterator<ShoppingCart.ProductPromoUseInfo> getProductPromoUseInfoIter()
-
getProductPromoTotal
public java.math.BigDecimal getProductPromoTotal()
-
getProductPromoUseTotalDiscount
public java.math.BigDecimal getProductPromoUseTotalDiscount(java.lang.String productPromoId)
Get total discount for a given ProductPromo, or for ANY ProductPromo if the passed in productPromoId is null.
-
getProductPromoUseCount
public int getProductPromoUseCount(java.lang.String productPromoId)
-
getProductPromoCodeUse
public int getProductPromoCodeUse(java.lang.String productPromoCodeId)
-
clearAllPromotionInformation
public void clearAllPromotionInformation()
-
clearAllPromotionAdjustments
public void clearAllPromotionAdjustments()
-
clearAllAdjustments
public void clearAllAdjustments()
-
clearAllItemStatus
public void clearAllItemStatus()
-
addProductPromoCode
public java.lang.String addProductPromoCode(java.lang.String productPromoCodeId, LocalDispatcher dispatcher)
Adds a promotion code to the cart, checking if it is valid. If it is valid this will return null, otherwise it will return a message stating why it was not valid- Parameters:
productPromoCodeId
- The promotion code to check and add- Returns:
- String that is null if valid, and added to cart, or an error message of the code was not valid and not added to the cart.
-
getProductPromoCodesEntered
public java.util.Set<java.lang.String> getProductPromoCodesEntered()
-
resetPromoRuleUse
public void resetPromoRuleUse(java.lang.String productPromoId, java.lang.String productPromoRuleId)
-
confirmPromoRuleUse
public void confirmPromoRuleUse(java.lang.String productPromoId, java.lang.String productPromoRuleId)
-
addAdditionalPartyRole
public void addAdditionalPartyRole(java.lang.String partyId, java.lang.String roleTypeId)
Associates a party with a role to the order.- Parameters:
partyId
- identifier of the party to associate to orderroleTypeId
- identifier of the role used in party-order association
-
removeAdditionalPartyRole
public void removeAdditionalPartyRole(java.lang.String partyId, java.lang.String roleTypeId)
Removes a previously associated party to the order.- Parameters:
partyId
- identifier of the party to associate to orderroleTypeId
- identifier of the role used in party-order association
-
getAdditionalPartyRoleMap
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAdditionalPartyRoleMap()
-
getAggregatedInstanceId
public java.lang.String getAggregatedInstanceId(ShoppingCartItem item, LocalDispatcher dispatcher)
Returns the Id of an AGGREGATED_CONF product having exact configId. If AGGREGATED_CONF product do not exist, creates one, associates it to the AGGREGATED product, and copy its production run template.- Parameters:
item
-dispatcher
-
-
makeOrderItemGroups
public java.util.List<GenericValue> makeOrderItemGroups()
-
explodeItems
public void explodeItems(java.util.List<ShoppingCartItem> shoppingCartItems, LocalDispatcher dispatcher)
Does an "explode", or "unitize" operation on a list of cart items. Resulting state for each item with quantity X is X items of quantity 1.- Parameters:
shoppingCartItems
-dispatcher
-
-
makeOrderItems
public java.util.List<GenericValue> makeOrderItems(LocalDispatcher dispatcher)
-
makeOrderItems
public java.util.List<GenericValue> makeOrderItems(boolean explodeItems, boolean replaceAggregatedId, LocalDispatcher dispatcher)
-
makeWorkEfforts
public java.util.List<GenericValue> makeWorkEfforts()
create WorkEfforts from the shoppingcart items when itemType = RENTAL_ORDER_ITEM
-
makeAllAdjustments
public java.util.List<GenericValue> makeAllAdjustments()
make a list of all adjustments including order adjustments, order line adjustments, and special adjustments (shipping and tax if applicable)
-
makeAllQuoteAdjustments
public java.util.List<GenericValue> makeAllQuoteAdjustments()
make a list of all quote adjustments including header adjustments, line adjustments, and special adjustments (shipping and tax if applicable). Internally, the quote adjustments are created from the order adjustments.
-
makeAllOrderPaymentInfos
public java.util.List<GenericValue> makeAllOrderPaymentInfos(LocalDispatcher dispatcher)
make a list of all OrderPaymentPreferences and Billing info including all payment methods and types
-
makeAllOrderItemPriceInfos
public java.util.List<GenericValue> makeAllOrderItemPriceInfos()
make a list of OrderItemPriceInfos from the ShoppingCartItems
-
makeProductPromoUses
public java.util.List<GenericValue> makeProductPromoUses()
-
makeAllOrderItemSurveyResponses
public java.util.List<GenericValue> makeAllOrderItemSurveyResponses()
make a list of SurveyResponse object to update with order information set
-
makeAllOrderContactMechs
public java.util.List<GenericValue> makeAllOrderContactMechs()
make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItems
-
makeAllOrderItemContactMechs
public java.util.List<GenericValue> makeAllOrderItemContactMechs()
make a list of OrderContactMechs from the ShoppingCart and the ShoppingCartItems
-
makeAllShipGroupInfos
public java.util.List<GenericValue> makeAllShipGroupInfos(LocalDispatcher dispatcher)
Return all OrderItemShipGroup, OrderContactMech, OrderAdjustment and OrderItemShipGroupAssoc from ShoppingCart in a single list ofGenericValue
- Parameters:
dispatcher
-- Returns:
-
getShipInfoSize
public int getShipInfoSize()
-
makeAllOrderItemAttributes
public java.util.List<GenericValue> makeAllOrderItemAttributes()
-
makeAllOrderItemAttributes
public java.util.List<GenericValue> makeAllOrderItemAttributes(java.lang.String orderId, int mode)
-
makeAllOrderAttributes
public java.util.List<GenericValue> makeAllOrderAttributes()
-
makeAllOrderAttributes
public java.util.List<GenericValue> makeAllOrderAttributes(java.lang.String orderId, int mode)
-
makeAllOrderItemAssociations
public java.util.List<GenericValue> makeAllOrderItemAssociations()
-
makeCartMap
public java.util.Map<java.lang.String,java.lang.Object> makeCartMap(LocalDispatcher dispatcher, boolean explodeItems)
Returns a Map of cart values to pass to the storeOrder service
-
getLineListOrderedByBasePrice
public java.util.List<ShoppingCartItem> getLineListOrderedByBasePrice(boolean ascending)
-
getShipGroupsBySupplier
public java.util.TreeMap<java.lang.Integer,ShoppingCart.CartShipInfo> getShipGroupsBySupplier(java.lang.String supplierPartyId)
-
createDropShipGroups
public java.util.Map<java.lang.String,java.lang.Object> createDropShipGroups(LocalDispatcher dispatcher) throws CartItemModifyException
Examine each item of each ship group and create new ship groups if the item should be drop shipped- Parameters:
dispatcher
-- Throws:
CartItemModifyException
-
getOrderAttributes
public java.util.Map<java.lang.String,java.lang.String> getOrderAttributes()
-
setOrderAttributes
public void setOrderAttributes(java.util.Map<java.lang.String,java.lang.String> orderAttributes)
-
getOrderStatusId
public java.lang.String getOrderStatusId()
-
setOrderStatusId
public void setOrderStatusId(java.lang.String orderStatusId)
-
getOrderStatusString
public java.lang.String getOrderStatusString()
-
setOrderStatusString
public void setOrderStatusString(java.lang.String orderStatusString)
-
getMinimumOrderQuantity
public static java.math.BigDecimal getMinimumOrderQuantity(Delegator delegator, java.math.BigDecimal itemBasePrice, java.lang.String itemProductId) throws GenericEntityException
- Throws:
GenericEntityException
-
-