Interface PromotableOrderItem
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
PromotableOrderItemImpl
-
Method Summary
Modifier and TypeMethodDescriptionorg.broadleafcommerce.common.money.MoneyReturns the value of all adjustments.org.broadleafcommerce.common.money.MoneyReturns the final total for this item taking into account the finalized adjustments.org.broadleafcommerce.common.money.MoneyReturns the total for this item if not adjustments applied.createNewDetail(int quantity) Creates a new detail with the associated quantity.org.broadleafcommerce.common.currency.domain.BroadleafCurrencyReturns the currency of the related order.org.broadleafcommerce.common.money.MoneyReturns the basePrice of the item (baseSalePrice or baseRetailPrice)Map available to implementations to store data needed for custom logic.Returns the underlying orderItem.Returns an OrderItemContainer for this OrderItem or null if this item is not an instance of OrderItemContainer.Returns the id of the contained OrderItemorg.broadleafcommerce.common.money.MoneygetPriceBeforeAdjustments(boolean applyToSalePrice) Return the salePriceBeforeAdjustments if the passed in param is true.Returns the list of priceDetails associated with this item.intReturns the quantity for this orderItemorg.broadleafcommerce.common.money.MoneyReturns the retailPrice without adjustmentsorg.broadleafcommerce.common.money.MoneyReturns the salePrice without adjustmentsbooleanReturns true if this item can receive item level discounts.booleanisOnSale()Returns true if the item has a sale price that is lower than the retail price.booleanReturns true if this PromotableOrderItem contains other itemsvoidMerges any priceDetails that share the same adjustments.voidEffectively deletes all priceDetails associated with this item and rvoidCalled by pricing engine to reset the state of this item.voidupdateRuleVariables(Map<String, Object> ruleVars) Adds the item to the rule variables map.
-
Method Details
-
updateRuleVariables
Adds the item to the rule variables map.- Parameters:
ruleVars-
-
resetPriceDetails
void resetPriceDetails()Called by pricing engine to reset the state of this item. -
isDiscountingAllowed
boolean isDiscountingAllowed()Returns true if this item can receive item level discounts.- Returns:
-
isOrderItemContainer
boolean isOrderItemContainer()Returns true if this PromotableOrderItem contains other items -
getOrderItemContainer
OrderItemContainer getOrderItemContainer()Returns an OrderItemContainer for this OrderItem or null if this item is not an instance of OrderItemContainer. -
getSalePriceBeforeAdjustments
org.broadleafcommerce.common.money.Money getSalePriceBeforeAdjustments()Returns the salePrice without adjustments -
getRetailPriceBeforeAdjustments
org.broadleafcommerce.common.money.Money getRetailPriceBeforeAdjustments()Returns the retailPrice without adjustments -
isOnSale
boolean isOnSale()Returns true if the item has a sale price that is lower than the retail price. -
getPromotableOrderItemPriceDetails
List<PromotableOrderItemPriceDetail> getPromotableOrderItemPriceDetails()Returns the list of priceDetails associated with this item.- Returns:
-
getPriceBeforeAdjustments
org.broadleafcommerce.common.money.Money getPriceBeforeAdjustments(boolean applyToSalePrice) Return the salePriceBeforeAdjustments if the passed in param is true. Otherwise return the retailPriceBeforeAdjustments.- Returns:
-
getCurrentBasePrice
org.broadleafcommerce.common.money.Money getCurrentBasePrice()Returns the basePrice of the item (baseSalePrice or baseRetailPrice)- Returns:
-
getQuantity
int getQuantity()Returns the quantity for this orderItem- Returns:
-
getCurrency
org.broadleafcommerce.common.currency.domain.BroadleafCurrency getCurrency()Returns the currency of the related order.- Returns:
-
removeAllItemAdjustments
void removeAllItemAdjustments()Effectively deletes all priceDetails associated with this item and r -
mergeLikeDetails
void mergeLikeDetails()Merges any priceDetails that share the same adjustments. -
getOrderItemId
Long getOrderItemId()Returns the id of the contained OrderItem -
calculateTotalAdjustmentValue
org.broadleafcommerce.common.money.Money calculateTotalAdjustmentValue()Returns the value of all adjustments. -
calculateTotalWithAdjustments
org.broadleafcommerce.common.money.Money calculateTotalWithAdjustments()Returns the final total for this item taking into account the finalized adjustments. Intended to be called after the adjustments have been finalized. -
calculateTotalWithoutAdjustments
org.broadleafcommerce.common.money.Money calculateTotalWithoutAdjustments()Returns the total for this item if not adjustments applied. -
createNewDetail
Creates a new detail with the associated quantity. Intended for use as part of the PriceDetail split.- Parameters:
quantity-- Returns:
-
getOrderItem
OrderItem getOrderItem()Returns the underlying orderItem. Manipulation of the underlying orderItem is not recommended. This method is intended for unit test and read only access although that is not strictly enforced.- Returns:
-
getExtraDataMap
Map available to implementations to store data needed for custom logic.
-