Class DiscreteOrderItemImpl
java.lang.Object
org.broadleafcommerce.core.order.domain.OrderItemImpl
org.broadleafcommerce.core.order.domain.DiscreteOrderItemImpl
- All Implemented Interfaces:
Serializable,Cloneable,AdminMainEntity,MultiTenantCloneable<OrderItem>,CurrencyCodeIdentifiable,DiscreteOrderItem,OrderItem,SkuAccessor
- Direct Known Subclasses:
DynamicPriceDiscreteOrderItemImpl,GiftWrapOrderItemImpl
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BigDecimalprotected BigDecimalprotected BundleOrderItemprotected Productprotected Skuprotected List<DiscreteOrderItemFeePrice>protected Productprotected Skuprotected SkuBundleItemFields inherited from class org.broadleafcommerce.core.order.domain.OrderItemImpl
auditable, candidateItemOffers, cartMessages, category, childOrderItems, deproxiedCategory, discountsAllowed, giftWrapOrderItem, hasValidationError, id, itemTaxable, name, order, orderItemAdjustments, orderItemAttributeMap, orderItemPriceDetails, orderItemQualifiers, orderItemType, parentOrderItem, personalMessage, price, proratedOrderItemAdjustments, quantity, retailPrice, retailPriceOverride, salePrice, salePriceOverride, totalTaxFields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()protected MoneyconvertToMoney(BigDecimal amount) booleanFor items that are part of a bundle, this method will return the parent bundle item.Arbitrary attributes associated with the order itemIf this item is part of a bundle, this method will return the containing bundle item.getName()Generally copied from the Sku.getName()getOrder()Reference back to the containing order.getSku()If this item is part of a bundle that was created via a ProductBundle, then this method returns a reference to the corresponding SkuBundleItem.inthashCode()booleanIf true, this item can be discounted..booleanReturns a boolean indicating whether this sku is active.Returns whether or not this item is taxable.voidsetAdditionalAttributes(Map<String, String> additionalAttributes) Arbitrary attributes associated with the order itemvoidsetBaseRetailPrice(Money baseRetailPrice) voidsetBaseSalePrice(Money baseSalePrice) voidsetBundleOrderItem(BundleOrderItem bundleOrderItem) Sets the parent bundle item.voidsetDiscreteOrderItemFeePrices(List<DiscreteOrderItemFeePrice> discreteOrderItemFeePrices) voidSets the order for this orderItem.voidsetProduct(Product product) voidvoidsetSkuBundleItem(SkuBundleItem SkuBundleItem) Sets the associated SkuBundleItem.protected booleanbooleanUsed to reset the base price of the item that the pricing engine uses.protected booleanMethods inherited from class org.broadleafcommerce.core.order.domain.OrderItemImpl
addCandidateItemOffer, assignFinalPrice, checkCloneable, convertOrderItemType, finalizePrice, getAdjustmentValue, getAuditable, getAverageAdjustmentValue, getAveragePrice, getCandidateItemOffers, getCartMessages, getCategory, getChildOrderItems, getCurrencyCode, getFutureCreditTotalAdjustmentValue, getFutureCreditTotalAdjustmentValue, getGiftWrapOrderItem, getHasValidationError, getId, getIsDiscounted, getIsOnSale, getMainEntityName, getOrderItemAdjustments, getOrderItemAttributes, getOrderItemPriceDetails, getOrderItemQualifiers, getOrderItemType, getParentOrderItem, getPersonalMessage, getPrice, getPriceBeforeAdjustments, getPriceBeforeAdjustments, getProratedOrderItemAdjustments, getQuantity, getRetailPrice, getSalePrice, getTaxablePrice, getTotalAdjustmentValue, getTotalAdjustmentValue, getTotalPrice, getTotalPrice, getTotalPriceBeforeAdjustments, isAParentOf, isChildOrderItem, isInCategory, isRetailPriceOverride, isSalePriceOverride, removeAllAdjustments, removeAllCandidateItemOffers, setAuditable, setCandidateItemOffers, setCartMessages, setCategory, setChildOrderItems, setDiscountingAllowed, setGiftWrapOrderItem, setHasValidationError, setId, setName, setOrderItemAdjustments, setOrderItemAttributes, setOrderItemPriceDetails, setOrderItemQualifiers, setOrderItemType, setParentOrderItem, setPersonalMessage, setPrice, setProratedOrderItemAdjustments, setQuantity, setRetailPrice, setRetailPriceOverride, setSalePrice, setSalePriceOverride, setTaxable, shouldSumChildrenMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.broadleafcommerce.core.order.domain.DiscreteOrderItem
getTaxablePriceMethods inherited from interface org.broadleafcommerce.core.order.domain.OrderItem
addCandidateItemOffer, assignFinalPrice, finalizePrice, getAdjustmentValue, getAuditable, getAverageAdjustmentValue, getAveragePrice, getCandidateItemOffers, getCartMessages, getCategory, getChildOrderItems, getFutureCreditTotalAdjustmentValue, getFutureCreditTotalAdjustmentValue, getGiftWrapOrderItem, getHasValidationError, getId, getIsDiscounted, getIsOnSale, getOrderItemAdjustments, getOrderItemAttributes, getOrderItemPriceDetails, getOrderItemQualifiers, getOrderItemType, getParentOrderItem, getPersonalMessage, getPrice, getPriceBeforeAdjustments, getPriceBeforeAdjustments, getProratedOrderItemAdjustments, getQuantity, getRetailPrice, getSalePrice, getTotalAdjustmentValue, getTotalAdjustmentValue, getTotalPrice, getTotalPrice, getTotalPriceBeforeAdjustments, isAParentOf, isChildOrderItem, isInCategory, isRetailPriceOverride, isSalePriceOverride, removeAllAdjustments, removeAllCandidateItemOffers, setAuditable, setCandidateItemOffers, setCartMessages, setCategory, setChildOrderItems, setDiscountingAllowed, setGiftWrapOrderItem, setHasValidationError, setId, setName, setOrderItemAdjustments, setOrderItemAttributes, setOrderItemPriceDetails, setOrderItemQualifiers, setOrderItemType, setParentOrderItem, setPersonalMessage, setPrice, setProratedOrderItemAdjustments, setQuantity, setRetailPrice, setRetailPriceOverride, setSalePrice, setSalePriceOverride, setTaxable
-
Field Details
-
baseRetailPrice
-
baseSalePrice
-
sku
-
product
-
bundleOrderItem
-
skuBundleItem
-
additionalAttributes
-
discreteOrderItemFeePrices
-
deproxiedSku
-
deproxiedProduct
-
-
Constructor Details
-
DiscreteOrderItemImpl
public DiscreteOrderItemImpl()
-
-
Method Details
-
getSku
- Specified by:
getSkuin interfaceDiscreteOrderItem- Specified by:
getSkuin interfaceSkuAccessor
-
setSku
- Specified by:
setSkuin interfaceDiscreteOrderItem
-
isTaxable
Description copied from interface:OrderItemReturns whether or not this item is taxable. If this flag is not set, it returns true by default- Specified by:
isTaxablein interfaceOrderItem- Overrides:
isTaxablein classOrderItemImpl- Returns:
- the taxable flag. If null, returns true
-
getProduct
- Specified by:
getProductin interfaceDiscreteOrderItem
-
setProduct
- Specified by:
setProductin interfaceDiscreteOrderItem
-
getBundleOrderItem
Description copied from interface:DiscreteOrderItemIf this item is part of a bundle, this method will return the containing bundle item.- Specified by:
getBundleOrderItemin interfaceDiscreteOrderItem- Returns:
-
setBundleOrderItem
Description copied from interface:DiscreteOrderItemSets the parent bundle item.Setting to null removes this item from the bundle.
- Specified by:
setBundleOrderItemin interfaceDiscreteOrderItem
-
getSkuBundleItem
If this item is part of a bundle that was created via a ProductBundle, then this method returns a reference to the corresponding SkuBundleItem. For manually created For all others, this method returns null.- Specified by:
getSkuBundleItemin interfaceDiscreteOrderItem- Returns:
-
setSkuBundleItem
Sets the associated SkuBundleItem.- Specified by:
setSkuBundleItemin interfaceDiscreteOrderItem- Parameters:
SkuBundleItem-
-
getName
Description copied from interface:OrderItemGenerally copied from the Sku.getName()- Specified by:
getNamein interfaceOrderItem- Overrides:
getNamein classOrderItemImpl- Returns:
-
getOrder
Description copied from interface:OrderItemReference back to the containing order.- Specified by:
getOrderin interfaceOrderItem- Overrides:
getOrderin classOrderItemImpl- Returns:
-
setOrder
Description copied from interface:OrderItemSets the order for this orderItem.- Specified by:
setOrderin interfaceOrderItem- Overrides:
setOrderin classOrderItemImpl
-
updateSalePrice
protected boolean updateSalePrice() -
updateRetailPrice
protected boolean updateRetailPrice() -
updateSaleAndRetailPrices
public boolean updateSaleAndRetailPrices()Description copied from interface:OrderItemUsed to reset the base price of the item that the pricing engine uses.Generally, this will update the retailPrice and salePrice based on the corresponding value in the SKU.
If the retail or sale price was manually set, this method will not change those prices.
For non-manually set prices, prices can change based on system activities such as locale changes and customer authentication, this method is used to ensure that all cart items reflect the current base price before executing other pricing / adjustment operations.
Other known scenarios that can effect the base prices include the automatic bundling or loading a stale cart from the database.
See notes in subclasses for specific behavior of this method.
- Specified by:
updateSaleAndRetailPricesin interfaceOrderItem- Overrides:
updateSaleAndRetailPricesin classOrderItemImpl- Returns:
- true if the base prices changed as a result of this call
-
getAdditionalAttributes
Description copied from interface:DiscreteOrderItemArbitrary attributes associated with the order item- Specified by:
getAdditionalAttributesin interfaceDiscreteOrderItem- Returns:
- the attributes
-
setAdditionalAttributes
Description copied from interface:DiscreteOrderItemArbitrary attributes associated with the order item- Specified by:
setAdditionalAttributesin interfaceDiscreteOrderItem- Parameters:
additionalAttributes- the map of attributes
-
getBaseRetailPrice
- Specified by:
getBaseRetailPricein interfaceDiscreteOrderItem
-
setBaseRetailPrice
- Specified by:
setBaseRetailPricein interfaceDiscreteOrderItem
-
getBaseSalePrice
- Specified by:
getBaseSalePricein interfaceDiscreteOrderItem
-
setBaseSalePrice
- Specified by:
setBaseSalePricein interfaceDiscreteOrderItem
-
getDiscreteOrderItemFeePrices
- Specified by:
getDiscreteOrderItemFeePricesin interfaceDiscreteOrderItem
-
setDiscreteOrderItemFeePrices
public void setDiscreteOrderItemFeePrices(List<DiscreteOrderItemFeePrice> discreteOrderItemFeePrices) - Specified by:
setDiscreteOrderItemFeePricesin interfaceDiscreteOrderItem
-
convertToMoney
- Overrides:
convertToMoneyin classOrderItemImpl
-
clone
- Specified by:
clonein interfaceOrderItem- Overrides:
clonein classOrderItemImpl
-
equals
- Overrides:
equalsin classOrderItemImpl
-
hashCode
public int hashCode()- Overrides:
hashCodein classOrderItemImpl
-
isDiscountingAllowed
public boolean isDiscountingAllowed()Description copied from interface:OrderItemIf true, this item can be discounted..- Specified by:
isDiscountingAllowedin interfaceOrderItem- Overrides:
isDiscountingAllowedin classOrderItemImpl
-
findParentItem
Description copied from interface:DiscreteOrderItemFor items that are part of a bundle, this method will return the parent bundle item. Otherwise, returns null.- Specified by:
findParentItemin interfaceDiscreteOrderItem- Returns:
-
createOrRetrieveCopyInstance
public CreateResponse<DiscreteOrderItem> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException - Specified by:
createOrRetrieveCopyInstancein interfaceMultiTenantCloneable<OrderItem>- Overrides:
createOrRetrieveCopyInstancein classOrderItemImpl- Throws:
CloneNotSupportedException
-
isSkuActive
public boolean isSkuActive()Description copied from interface:OrderItemReturns a boolean indicating whether this sku is active. This is used to determine whether a user the sku can add the sku to their cart.- Specified by:
isSkuActivein interfaceDiscreteOrderItem- Specified by:
isSkuActivein interfaceOrderItem- Overrides:
isSkuActivein classOrderItemImpl
-