java.lang.Object
org.broadleafcommerce.core.catalog.domain.SkuImpl
All Implemented Interfaces:
Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<Sku>, Indexable, Sku, SkuAdminPresentation

@Entity public class SkuImpl extends Object implements Sku, SkuAdminPresentation
The Class SkuImpl is the default implementation of Sku. A SKU is a specific item that can be sold including any specific attributes of the item such as color or size.

If you want to add fields specific to your implementation of BroadLeafCommerce you should extend this class and add your fields. If you need to make significant changes to the SkuImpl then you should implement your own version of Sku.

This implementation uses a Hibernate implementation of JPA configured through annotations. The Entity references the following tables: BLC_SKU, BLC_SKU_IMAGE

!!!!!!!!!!!!!!!!!

For admin required field validation, if this Sku is apart of an additionalSkus list (meaning it is not a defaultSku) then it should have no required restrictions on it. All additional Skus can delegate to the defaultSku of the related product for all of its fields. For this reason, if you would like to mark more fields as required then rather than using AdminPresentation.requiredOverride(), use the mo:overrides section in bl-admin-applicationContext.xml for Product and reference each required field like 'defaultSku.name' or 'defaultSku.retailPrice'.

Author:
btaylor
See Also:
  • Field Details

    • id

      protected Long id
    • externalId

      protected String externalId
    • urlKey

      protected String urlKey
    • displayTemplate

      protected String displayTemplate
    • upc

      protected String upc
    • salePrice

      protected BigDecimal salePrice
    • retailPrice

      protected BigDecimal retailPrice
    • cost

      protected BigDecimal cost
    • name

      protected String name
    • description

      protected String description
    • longDescription

      protected String longDescription
    • taxCode

      protected String taxCode
    • taxable

      protected Character taxable
    • discountable

      protected Character discountable
    • available

      @Deprecated protected Character available
      Deprecated.
    • activeStartDate

      protected Date activeStartDate
    • activeEndDate

      protected Date activeEndDate
    • dimension

      protected Dimension dimension
    • weight

      protected Weight weight
    • isMachineSortable

      protected Boolean isMachineSortable
    • skuMedia

      protected Map<String,SkuMediaXref> skuMedia
    • legacySkuMedia

      protected Map<String,org.broadleafcommerce.common.media.domain.Media> legacySkuMedia
    • defaultProduct

      protected Product defaultProduct
      This will be non-null if and only if this Sku is the default Sku for a Product
    • product

      protected Product product
      This relationship will be non-null if and only if this Sku is contained in the list of additional Skus for a Product (for Skus based on ProductOptions)
    • skuAttributes

      protected List<SkuAttribute> skuAttributes
    • productOptionValueXrefs

      protected Set<SkuProductOptionValueXref> productOptionValueXrefs
    • legacyProductOptionValues

      protected Set<ProductOptionValue> legacyProductOptionValues
    • fees

      protected List<SkuFee> fees
    • fulfillmentFlatRates

      protected Map<FulfillmentOption,BigDecimal> fulfillmentFlatRates
    • excludedFulfillmentOptions

      protected List<FulfillmentOption> excludedFulfillmentOptions
    • inventoryType

      protected String inventoryType
    • quantityAvailable

      protected Integer quantityAvailable
    • fulfillmentType

      protected String fulfillmentType
    • currency

      protected org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency
      Note that this field is not the target of the currencyCodeField attribute on either retailPrice or salePrice. This is because SKUs are special in that we want to return the currency on this SKU if there is one, falling back to the defaultSku's currency if possible.

      Normally null and hidden. Use Meta-Data overrides to display in the admin.

      See Also:
  • Constructor Details

    • SkuImpl

      public SkuImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: Sku
      Returns the id of this sku
      Specified by:
      getId in interface Indexable
      Specified by:
      getId in interface Sku
    • setId

      public void setId(Long id)
      Description copied from interface: Sku
      Sets the id of this sku
      Specified by:
      setId in interface Sku
    • getUrlKey

      public String getUrlKey()
      Description copied from interface: Sku
      Returns the sku specific portion of a full url used for a sku info page.
      Specified by:
      getUrlKey in interface Sku
    • setUrlKey

      public void setUrlKey(String urlKey)
      Description copied from interface: Sku
      Sets the sku specific portion of a full url used for a sku info page.
      Specified by:
      setUrlKey in interface Sku
    • getDisplayTemplate

      public String getDisplayTemplate()
      Description copied from interface: Sku
      Returns the name of a display template that is used to render this sku. Most implementations have a default template for all skus. This allows for the user to define a specific template to be used by this sku.
      Specified by:
      getDisplayTemplate in interface Sku
      Returns:
    • setDisplayTemplate

      public void setDisplayTemplate(String displayTemplate)
      Description copied from interface: Sku
      Sets the name of a display template that is used to render this sku. Most implementations have a default template for all skus. This allows for the user to define a specific template to be used by this sku.
      Specified by:
      setDisplayTemplate in interface Sku
    • isOnSale

      public boolean isOnSale()
      Description copied from interface: Sku
      A product is on sale provided the sale price is not null, non-zero, and less than the retail price.

      Note that this flag should always be checked before showing or using a sale price as it is possible for a sale price to be greater than the retail price from a purely data perspective.

      Specified by:
      isOnSale in interface Sku
      Returns:
      whether or not the product is on sale
    • hasDefaultSku

      protected boolean hasDefaultSku()
    • lookupDefaultSku

      protected Sku lookupDefaultSku()
    • getProductOptionValueAdjustments

      public org.broadleafcommerce.common.money.Money getProductOptionValueAdjustments()
      Description copied from interface: Sku
      This is the sum total of the priceAdjustments from the associated ProductOptionValues
      Specified by:
      getProductOptionValueAdjustments in interface Sku
      Returns:
      null if there are no ProductOptionValues associated with this Sku or all of their priceAdjustments are null. Otherwise this will be the sum total of those price adjustments
    • getSalePrice

      public org.broadleafcommerce.common.money.Money getSalePrice()
      Description copied from interface: Sku
      Returns the Sale Price of the Sku. The Sale Price is the standard price the vendor sells this item for. If SkuPricingConsiderationContext is set, this uses the DynamicSkuPricingService to calculate what this should actually be rather than use the property itself
      Specified by:
      getSalePrice in interface Sku
    • setSalePrice

      public void setSalePrice(org.broadleafcommerce.common.money.Money salePrice)
      Description copied from interface: Sku
      Sets the the Sale Price of the Sku. The Sale Price is the standard price the vendor sells this item for. This price will automatically be overridden if your system is utilizing the DynamicSkuPricingService.
      Specified by:
      setSalePrice in interface Sku
    • hasSalePrice

      public boolean hasSalePrice()
      Description copied from interface: Sku
      Determines if there is a sale price. In other words, determines whether salePrice is null. Returns true if salePrice is not null. Returns false otherwise.
      Specified by:
      hasSalePrice in interface Sku
      Returns:
    • getRetailPrice

      public org.broadleafcommerce.common.money.Money getRetailPrice()
      Description copied from interface: Sku
      Returns the Retail Price of the Sku. The Retail Price is the MSRP of the sku. If SkuPricingConsiderationContext is set, this uses the DynamicSkuPricingService to calculate what this should actually be rather than use the property itself.
      Specified by:
      getRetailPrice in interface Sku
    • setRetailPrice

      public void setRetailPrice(org.broadleafcommerce.common.money.Money retailPrice)
      Description copied from interface: Sku
      Sets the retail price for the Sku. This price will automatically be overridden if your system is utilizing the DynamicSkuPricingService.
      Specified by:
      setRetailPrice in interface Sku
      Parameters:
      retailPrice - price for the Sku
    • getRetailPriceInternal

      protected org.broadleafcommerce.common.money.Money getRetailPriceInternal()
    • getBaseRetailPrice

      public org.broadleafcommerce.common.money.Money getBaseRetailPrice()
      Description copied from interface: Sku
      Returns the basic retail price of the Sku. This price does not include any dynamic pricing, including PriceList modification.
      Specified by:
      getBaseRetailPrice in interface Sku
      Returns:
    • getBaseSalePrice

      public org.broadleafcommerce.common.money.Money getBaseSalePrice()
      Description copied from interface: Sku
      Returns the basic sale price of the Sku. This price does not include any dynamic pricing, including PriceList modification.
      Specified by:
      getBaseSalePrice in interface Sku
      Returns:
    • getPriceData

      public DynamicSkuPrices getPriceData()
      Description copied from interface: Sku
      If a DynamicPricingService is being used, this method will return the dynamic Sku prices. Otherwise, it will return an instance of DynamicSkuPrices with the retail and sale price from the underlying record.
      Specified by:
      getPriceData in interface Sku
      Returns:
    • hasRetailPrice

      public boolean hasRetailPrice()
      Description copied from interface: Sku
      Provides a way of determining if a Sku has a retail price without getting an IllegalStateException. Returns true if retailPrice is not null. Returns false otherwise.
      Specified by:
      hasRetailPrice in interface Sku
      Returns:
      See Also:
    • getPrice

      public org.broadleafcommerce.common.money.Money getPrice()
      Description copied from interface: Sku
      Resolves the price of the Sku. If the Sku is on sale (that is, isOnSale() returns true), the return value will be the result of getSalePrice(). Otherwise, the return value will be the result of getRetailPrice().
      Specified by:
      getPrice in interface Sku
      Returns:
      the price of the Sku
    • getListPrice

      @Deprecated public org.broadleafcommerce.common.money.Money getListPrice()
      Deprecated.
      Description copied from interface: Sku
      Returns the List Price of the Sku. The List Price is the MSRP of the sku.
      Specified by:
      getListPrice in interface Sku
    • setListPrice

      @Deprecated public void setListPrice(org.broadleafcommerce.common.money.Money listPrice)
      Deprecated.
      Description copied from interface: Sku
      Sets the the List Price of the Sku. The List Price is the MSRP of the sku.
      Specified by:
      setListPrice in interface Sku
    • getCost

      public org.broadleafcommerce.common.money.Money getCost()
      Description copied from interface: Sku
      Returns the purchase cost of this Sku.
      Specified by:
      getCost in interface Sku
      Returns:
      the purchase cost of this Sku
    • setCost

      public void setCost(org.broadleafcommerce.common.money.Money cost)
      Description copied from interface: Sku
      Sets the purchase cost for this Sku.
      Specified by:
      setCost in interface Sku
    • getMargin

      public org.broadleafcommerce.common.money.Money getMargin()
      Description copied from interface: Sku
      Returns the margin of the Sku. This is the value of getPrice() - getCost()
      Specified by:
      getMargin in interface Sku
      Returns:
      the margin of this Sku
    • getName

      public String getName()
      Description copied from interface: Sku
      Returns the name of the Sku. The name is a label used to show when displaying the sku.
      Specified by:
      getName in interface Sku
    • setName

      public void setName(String name)
      Description copied from interface: Sku
      Sets the the name of the Sku. The name is a label used to show when displaying the sku.
      Specified by:
      setName in interface Sku
    • getDescription

      public String getDescription()
      Description copied from interface: Sku
      Returns the brief description of the Sku.
      Specified by:
      getDescription in interface Sku
    • setDescription

      public void setDescription(String description)
      Description copied from interface: Sku
      Sets the brief description of the Sku.
      Specified by:
      setDescription in interface Sku
    • getLongDescription

      public String getLongDescription()
      Description copied from interface: Sku
      Returns the long description of the sku.
      Specified by:
      getLongDescription in interface Sku
    • setLongDescription

      public void setLongDescription(String longDescription)
      Description copied from interface: Sku
      Sets the long description of the sku.
      Specified by:
      setLongDescription in interface Sku
    • isTaxable

      public Boolean isTaxable()
      Description copied from interface: Sku
      Returns whether the Sku qualifies for taxes or not. This field is used by the pricing engine to calculate taxes.
      Specified by:
      isTaxable in interface Sku
    • getTaxable

      public Boolean getTaxable()
      Description copied from interface: Sku
      Convenience that passes through to isTaxable
      Specified by:
      getTaxable in interface Sku
    • setTaxable

      public void setTaxable(Boolean taxable)
      Description copied from interface: Sku
      Sets the whether the Sku qualifies for taxes or not. This field is used by the pricing engine to calculate taxes.
      Specified by:
      setTaxable in interface Sku
    • isDiscountable

      public Boolean isDiscountable()
      Description copied from interface: Sku
      Returns whether the Sku qualifies for discounts or not. This field is used by the pricing engine to apply offers.
      Specified by:
      isDiscountable in interface Sku
    • getDiscountable

      public Boolean getDiscountable()
    • setDiscountable

      public void setDiscountable(Boolean discountable)
      Description copied from interface: Sku
      Sets the whether the Sku qualifies for discounts or not. This field is used by the pricing engine to apply offers.
      Specified by:
      setDiscountable in interface Sku
    • isAvailable

      public Boolean isAvailable()
      Description copied from interface: Sku

      Availability is really a concern of inventory vs a concern of the Sku being active or not. A Sku could be marked as unavailable but still be considered 'active' where you still want to show the Sku on the site but not actually sell it. This defaults to true

      This method only checks that this Sku is not marked as InventoryType.UNAVAILABLE. If Sku.getInventoryType() is set to InventoryType.CHECK_QUANTITY then this will return true.

      Specified by:
      isAvailable in interface Sku
    • getAvailable

      public Boolean getAvailable()
      Description copied from interface: Sku
      Convenience that passes through to isAvailable
      Specified by:
      getAvailable in interface Sku
    • setAvailable

      public void setAvailable(Boolean available)
      Description copied from interface: Sku
      Availability is really a concern of inventory vs a concern of the Sku being active or not. A Sku could be marked as unavailable but still be considered 'active' where you still want to show the Sku on the site but not actually sell it. This defaults to true
      Specified by:
      setAvailable in interface Sku
    • getActiveStartDate

      public Date getActiveStartDate()
      Description copied from interface: Sku
      Returns the first date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.
      Specified by:
      getActiveStartDate in interface Sku
    • setActiveStartDate

      public void setActiveStartDate(Date activeStartDate)
      Description copied from interface: Sku
      Sets the the first date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.
      Specified by:
      setActiveStartDate in interface Sku
    • getActiveEndDate

      public Date getActiveEndDate()
      Description copied from interface: Sku
      Returns the the last date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.
      Specified by:
      getActiveEndDate in interface Sku
    • setActiveEndDate

      public void setActiveEndDate(Date activeEndDate)
      Description copied from interface: Sku
      Sets the the last date that the Sku should be available for sale. This field is used to determine whether a user can add the sku to their cart.
      Specified by:
      setActiveEndDate in interface Sku
    • getDimension

      public Dimension getDimension()
      Description copied from interface: Sku
      Get the dimensions for this Sku
      Specified by:
      getDimension in interface Sku
      Returns:
      this Sku's embedded Weight
    • setDimension

      public void setDimension(Dimension dimension)
      Description copied from interface: Sku
      Sets the embedded Dimension for this Sku
      Specified by:
      setDimension in interface Sku
    • getWeight

      public Weight getWeight()
      Description copied from interface: Sku
      Gets the embedded Weight for this Sku
      Specified by:
      getWeight in interface Sku
      Returns:
      this Sku's embedded Weight
    • setWeight

      public void setWeight(Weight weight)
      Description copied from interface: Sku
      Sets the embedded Weight for this Sku
      Specified by:
      setWeight in interface Sku
    • isActive

      public boolean isActive()
      Description copied from interface: Sku
      Returns 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:
      isActive in interface Sku
    • isActive

      public boolean isActive(Product product, Category category)
      Description copied from interface: Sku
      Returns whether or not this Sku, the given Product and the given Category are all active
      Specified by:
      isActive in interface Sku
      Parameters:
      product - - Product that should be active
      category - - Category that should be active
      Returns:
      true if this Sku, product and category are all active false otherwise
    • getSkuMedia

      @Deprecated public Map<String,org.broadleafcommerce.common.media.domain.Media> getSkuMedia()
      Deprecated.
      Description copied from interface: Sku
      Returns a map of key/value pairs where the key is a string for the name of a media object and the value is a media object.
      Specified by:
      getSkuMedia in interface Sku
    • setSkuMedia

      @Deprecated public void setSkuMedia(Map<String,org.broadleafcommerce.common.media.domain.Media> skuMedia)
      Deprecated.
      Description copied from interface: Sku
      Sets a map of key/value pairs where the key is a string for the name of a media object and the value is an object of type Media.
      Specified by:
      setSkuMedia in interface Sku
    • getSkuMediaXref

      public Map<String,SkuMediaXref> getSkuMediaXref()
      Description copied from interface: Sku
      Returns a map of key/value pairs where the key is a string for the name of a media object and the value is a cross-reference to a media object.
      Specified by:
      getSkuMediaXref in interface Sku
    • setSkuMediaXref

      public void setSkuMediaXref(Map<String,SkuMediaXref> skuMediaXref)
      Description copied from interface: Sku
      Sets a map of key/value pairs where the key is a string for the name of a media object and the value is a cross-reference object to type Media.
      Specified by:
      setSkuMediaXref in interface Sku
    • getSkuMediaXrefIgnoreDefaultSku

      public Map<String,SkuMediaXref> getSkuMediaXrefIgnoreDefaultSku()
      Description copied from interface: Sku
      Returns a map of key/value pairs where the key is a string for the name of a media object and the value is a cross-reference to a media object. This is intended to be used when cloning Skus and does not check the defaultSku unlike Sku.getSkuMediaXref().
      Specified by:
      getSkuMediaXrefIgnoreDefaultSku in interface Sku
    • getPrimarySkuMedia

      public org.broadleafcommerce.common.media.domain.Media getPrimarySkuMedia()
      Description copied from interface: Sku
      Returns the primary Media for this Sku
      Specified by:
      getPrimarySkuMedia in interface Sku
    • isOrderedSkuMedia

      protected boolean isOrderedSkuMedia(Map<String,SkuMediaXref> skuMedia)
    • sortSkuMedia

      protected Map<String,SkuMediaXref> sortSkuMedia(Map<String,SkuMediaXref> skuMedia)
    • getDefaultProduct

      public Product getDefaultProduct()
      Description copied from interface: Sku
      This will be a value if and only if this Sku is the defaultSku of a Product (and thus has a @OneToOne relationship with a Product). The mapping for this is actually done at the Product level with a foreign key to Sku; this exists for convenience to get the reverse relationship
      Specified by:
      getDefaultProduct in interface Sku
      Returns:
      The associated Product if this Sku is a defaultSku, null otherwise
      See Also:
    • setDefaultProduct

      public void setDefaultProduct(Product defaultProduct)
      Description copied from interface: Sku
      The relationship for a Product's default Sku (and thus a Sku's default Product) is actually maintained on the Product entity as a foreign key to Sku. Because of this, there are probably very few circumstances that you would actually want to change this from the Sku perspective instead of the Product perspective.

      If you are looking for a way to simply associate a Sku to a Product, the correct way would be to call Sku.setProduct(Product) or Product.setAdditionalSkus(List) which would then cause this Sku to show up in the list of Skus for the given Product
      Specified by:
      setDefaultProduct in interface Sku
    • getProduct

      public Product getProduct()
      Description copied from interface: Sku
      This will return the correct Product association that is being used on the Sku. If this Sku is a default Sku for a Product (as in, Sku.getDefaultProduct() != null) than this will return Sku.getDefaultProduct(). If this is not a default Sku for a Product, this will return the @ManyToOne Product relationship created by adding this Sku to a Product's list of Skus, or using Sku.setProduct(Product).

      In some implementations, it might make sense to have both the @OneToOne association set (Product.setDefaultSku(Sku)) as well as the @ManyToOne association set (Sku.setProduct(Product)). In this case, This method would only return the result of Sku.getDefaultProduct(). However, the @OneToOne and @ManyToOne association should never actually refer to different Products, and would represent an error state. If you require this, consider subclassing and using your own @ManyToMany relationship between Product and Sku. If you are trying to model bundles, consider using a ProductBundle and subsequent SkuBundleItems.
      Specified by:
      getProduct in interface Sku
      Returns:
      Sku.getDefaultProduct() if Sku.getDefaultProduct() is non-null, the @ManyToOne Product association otherwise. If no relationship is set, returns null
    • setProduct

      public void setProduct(Product product)
      Description copied from interface: Sku
      Associates a Sku to a given Product. This will then show up in the list returned by Product.getSkus()
      Specified by:
      setProduct in interface Sku
      Parameters:
      product - - Product to associate this Sku to
      See Also:
    • getProductOptionValueXrefs

      public Set<SkuProductOptionValueXref> getProductOptionValueXrefs()
      Description copied from interface: Sku
      Returns the ProductOptionValues that should be mapped to this Sku using the middle XREF entity, SkuProductOptionValueXref
      Specified by:
      getProductOptionValueXrefs in interface Sku
      Returns:
      the Set of SkuProductOptionValueXrefs
    • setProductOptionValueXrefs

      public void setProductOptionValueXrefs(Set<SkuProductOptionValueXref> productOptionValueXrefs)
      Description copied from interface: Sku
      Sets the ProductOptionValues that should be mapped to this Sku using the middle XREF entity, SkuProductOptionValueXref
      Specified by:
      setProductOptionValueXrefs in interface Sku
    • getProductOptionValuesCollection

      public Set<ProductOptionValue> getProductOptionValuesCollection()
      Description copied from interface: Sku
      Gets the ProductOptionValues used to map to this Sku. For instance, this Sku could hold specific inventory, price and image information for a "Blue" "Extra-Large" shirt
      Specified by:
      getProductOptionValuesCollection in interface Sku
      Returns:
      the ProductOptionValues for this Sku
    • setProductOptionValuesCollection

      public void setProductOptionValuesCollection(Set<ProductOptionValue> productOptionValues)
      Description copied from interface: Sku
      Sets the ProductOptionValues that should be mapped to this Sku
      Specified by:
      setProductOptionValuesCollection in interface Sku
    • getProductOptionValues

      @Deprecated public List<ProductOptionValue> getProductOptionValues()
      Deprecated.
      Description copied from interface: Sku
      Gets the ProductOptionValues used to map to this Sku. For instance, this Sku could hold specific inventory, price and image information for a "Blue" "Extra-Large" shirt
      Specified by:
      getProductOptionValues in interface Sku
      Returns:
      the ProductOptionValues for this Sku
    • setProductOptionValues

      @Deprecated public void setProductOptionValues(List<ProductOptionValue> productOptionValues)
      Deprecated.
      Description copied from interface: Sku
      Sets the ProductOptionValues that should be mapped to this Sku
      Specified by:
      setProductOptionValues in interface Sku
    • isMachineSortable

      @Deprecated public Boolean isMachineSortable()
      Deprecated.
      Description copied from interface: Sku
      Whether this Sku can be sorted by a machine
      Specified by:
      isMachineSortable in interface Sku
      Returns:
      true if this Sku can be sorted by a machine
    • getIsMachineSortable

      public Boolean getIsMachineSortable()
      Description copied from interface: Sku
      Whether this Sku can be sorted by a machine
      Specified by:
      getIsMachineSortable in interface Sku
    • setIsMachineSortable

      public void setIsMachineSortable(Boolean isMachineSortable)
      Description copied from interface: Sku
      Sets whether or not this Sku can be sorted by a machine
      Specified by:
      setIsMachineSortable in interface Sku
    • setMachineSortable

      @Deprecated public void setMachineSortable(Boolean isMachineSortable)
      Deprecated.
      Description copied from interface: Sku
      Sets whether or not this Sku can be sorted by a machine
      Specified by:
      setMachineSortable in interface Sku
    • getFees

      public List<SkuFee> getFees()
      Description copied from interface: Sku
      Gets all the extra fees for this particular Sku. If the fee type is FULFILLMENT, these are stored on FulfillmentGroup.getFulfillmentGroupFees() for an Order
      Specified by:
      getFees in interface Sku
      Returns:
      the SkuFees for this Sku
    • setFees

      public void setFees(List<SkuFee> fees)
      Description copied from interface: Sku
      Sets the extra fees for this particular Sku
      Specified by:
      setFees in interface Sku
    • getFulfillmentFlatRates

      public Map<FulfillmentOption,BigDecimal> getFulfillmentFlatRates()
      Description copied from interface: Sku
      Gets the flat rate for fulfilling this Sku for a particular FulfillmentOption. Depending on the result of FulfillmentOption.getUseFlatRates(), this flat rate will be used in calculating the cost of fulfilling this Sku.
      Specified by:
      getFulfillmentFlatRates in interface Sku
      Returns:
      the flat rates for this Sku
    • setFulfillmentFlatRates

      public void setFulfillmentFlatRates(Map<FulfillmentOption,BigDecimal> fulfillmentFlatRates)
      Description copied from interface: Sku
      Sets the flat rates for fulfilling this Sku for a particular FulfillmentOption. Depending on the result of FulfillmentOption.getUseFlatRates(), this flat rate will be used in calculating the cost of fulfilling this Sku.
      Specified by:
      setFulfillmentFlatRates in interface Sku
    • getExcludedFulfillmentOptions

      public List<FulfillmentOption> getExcludedFulfillmentOptions()
      Description copied from interface: Sku
      Gets the FulfillmentOptions that this Sku should be excluded from. For instance, some Skus might not be available to be fulfilled next-day
      Specified by:
      getExcludedFulfillmentOptions in interface Sku
      Returns:
    • setExcludedFulfillmentOptions

      public void setExcludedFulfillmentOptions(List<FulfillmentOption> excludedFulfillmentOptions)
      Description copied from interface: Sku
      Sets the FulfillmentOptions that this Sku should be excluded from being apart of
      Specified by:
      setExcludedFulfillmentOptions in interface Sku
    • getInventoryType

      public InventoryType getInventoryType()
      Description copied from interface: Sku
      Returns the type of inventory for this sku
      Specified by:
      getInventoryType in interface Sku
      Returns:
      the InventoryType for this sku
    • setInventoryType

      public void setInventoryType(InventoryType inventoryType)
      Description copied from interface: Sku
      Sets the type of inventory for this sku
      Specified by:
      setInventoryType in interface Sku
      Parameters:
      inventoryType - the InventoryType for this sku
    • getQuantityAvailable

      public Integer getQuantityAvailable()
      Description copied from interface: Sku

      Used in conjuction with InventoryType.CHECK_QUANTITY within the blAddItemWorkflow and blUpdateItemWorkflow. This field is checked within the CheckAddAvailabilityActivity to determine if inventory is actually available for this Sku.

      Specified by:
      getQuantityAvailable in interface Sku
    • setQuantityAvailable

      public void setQuantityAvailable(Integer quantityAvailable)
      Description copied from interface: Sku

      Used in conjunction with InventoryType.CHECK_QUANTITY from Sku.getInventoryType(). This sets how much inventory is available for this Sku.

      Specified by:
      setQuantityAvailable in interface Sku
      Parameters:
      quantityAvailable - the quantity available for this sku
    • getFulfillmentType

      public FulfillmentType getFulfillmentType()
      Description copied from interface: Sku
      Returns the fulfillment type for this sku. May be null.
      Specified by:
      getFulfillmentType in interface Sku
      Returns:
    • setFulfillmentType

      public void setFulfillmentType(FulfillmentType fulfillmentType)
      Description copied from interface: Sku
      Sets the fulfillment type for this sku. May return null.
      Specified by:
      setFulfillmentType in interface Sku
    • getSkuAttributes

      @Deprecated public Map<String,SkuAttribute> getSkuAttributes()
      Deprecated.
      Description copied from interface: Sku
      Denormalized set of key-value pairs to attach to a Sku. If you are looking for setting up a ProductOption scenario (like colors, sizes, etc) see Sku.getProductOptionValues() and Sku.setProductOptionValues(List)
      Specified by:
      getSkuAttributes in interface Sku
      Returns:
      the attributes for this Sku
    • setSkuAttributes

      public void setSkuAttributes(Map<String,SkuAttribute> skuAttributes)
      Description copied from interface: Sku
      Sets the denormalized set of key-value pairs on a Sku
      Specified by:
      setSkuAttributes in interface Sku
    • getMultiValueSkuAttributes

      public Map<String,Collection<SkuAttribute>> getMultiValueSkuAttributes()
      Description copied from interface: Sku
      Returns multivalued SkuAttributes associated with this sku using MultiValueMap. For example, the key of Color could have SkuAttributes of Red and Blue values.
      Specified by:
      getMultiValueSkuAttributes in interface Sku
      Returns:
      the multivalued attributes for this Sku
    • getCurrency

      public org.broadleafcommerce.common.currency.domain.BroadleafCurrency getCurrency()
      Description copied from interface: Sku
      Note: When using dynamic pricing, this method is unreliable and should not be called outside of the Broadleaf admin Instead, you should rely on the BroadleafRequestContext.getBroadleafCurrency() instead of storing at the SKU level.

      As such, for supported, enterprise installations, this method should always return null.

      This method was not deprecated as it may have some use in non-standard Broadleaf installations but using its use is not suggested for most implementations.

      Specified by:
      getCurrency in interface Sku
      Returns:
      the currency for this sku
    • setCurrency

      public void setCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency)
      Description copied from interface: Sku
      Sets the currency for this Sku

      Note: Currency is ignored when using dynamic pricing

      Specified by:
      setCurrency in interface Sku
    • clearDynamicPrices

      public void clearDynamicPrices()
      Description copied from interface: Sku
      Clears any currently stored dynamic pricing
      Specified by:
      clearDynamicPrices in interface Sku
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getTaxCode

      public String getTaxCode()
      Description copied from interface: Sku
      Returns the Tax Code for this particular Entity.

      If the current Tax Code on the Sku is null, the Product tax code will be returned.

      Specified by:
      getTaxCode in interface Sku
      Returns:
      taxCode
    • setTaxCode

      public void setTaxCode(String taxCode)
      Description copied from interface: Sku
      Sets the tax code for this SKU
      Specified by:
      setTaxCode in interface Sku
    • getExternalId

      public String getExternalId()
      Description copied from interface: Sku
      Intended to hold any unique identifier not tied to the Broadleaf Database Sequence Identifier. For example, many implementations may integrate or import/export data from other systems that manage their own unique identifiers.
      Specified by:
      getExternalId in interface Sku
      Returns:
      external ID
    • setExternalId

      public void setExternalId(String externalId)
      Description copied from interface: Sku
      Sets a unique external ID
      Specified by:
      setExternalId in interface Sku
    • getUpc

      public String getUpc()
      Description copied from interface: Sku
      Gets the Universal Product Code (UPC)
      Specified by:
      getUpc in interface Sku
      Returns:
    • setUpc

      public void setUpc(String upc)
      Description copied from interface: Sku
      Sets the Universal Product Code (UPC)
      Specified by:
      setUpc in interface Sku
    • getFieldEntityType

      public FieldEntity getFieldEntityType()
      Description copied from interface: Indexable
      Which type of Field should be queried for when looking up database-driven search fields to store in the search index
      Specified by:
      getFieldEntityType in interface Indexable
      See Also:
    • createOrRetrieveCopyInstance

      public <G extends Sku> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException
      Specified by:
      createOrRetrieveCopyInstance in interface org.broadleafcommerce.common.copy.MultiTenantCloneable<Sku>
      Throws:
      CloneNotSupportedException