public interface Sku extends Serializable
SkuImpl.SkuImpl}, {@link Money}| Modifier and Type | Method and Description |
|---|---|
void |
clearDynamicPrices()
Clears any currently stored dynamic pricing
|
Date |
getActiveEndDate()
Returns the the last date that the Sku should be available for sale.
|
Date |
getActiveStartDate()
Returns the first date that the Sku should be available for sale.
|
Boolean |
getAvailable()
Deprecated.
use
getInventoryType() instead |
BroadleafCurrency |
getCurrency()
Returns the currency for this sku if there is one set.
|
Product |
getDefaultProduct()
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).
|
String |
getDescription()
Returns the brief description of the Sku.
|
Dimension |
getDimension()
Get the dimensions for this Sku
|
List<FulfillmentOption> |
getExcludedFulfillmentOptions()
Gets the
FulfillmentOptions that this Sku should be excluded from. |
List<SkuFee> |
getFees()
Gets all the extra fees for this particular Sku.
|
Map<FulfillmentOption,BigDecimal> |
getFulfillmentFlatRates()
Gets the flat rate for fulfilling this
Sku for a particular FulfillmentOption. |
FulfillmentType |
getFulfillmentType()
Returns the fulfillment type for this sku.
|
Long |
getId()
Returns the id of this sku
|
InventoryType |
getInventoryType()
Returns the type of inventory for this sku
|
Boolean |
getIsMachineSortable()
Whether this Sku can be sorted by a machine
|
Money |
getListPrice()
Deprecated.
|
String |
getLongDescription()
Returns the long description of the sku.
|
String |
getName()
Returns the name of the Sku.
|
Money |
getPrice()
Resolves the price of the Sku.
|
Product |
getProduct()
This will return the correct Product association that is being used on the Sku.
|
Money |
getProductOptionValueAdjustments()
This is the sum total of the priceAdjustments from the associated ProductOptionValues
|
List<ProductOptionValue> |
getProductOptionValues()
Deprecated.
use
getProductOptionValuesCollection() instead |
Set<ProductOptionValue> |
getProductOptionValuesCollection()
Gets the ProductOptionValues used to map to this Sku.
|
Integer |
getQuantityAvailable()
Used in conjuction with
InventoryType.CHECK_QUANTITY within the blAddItemWorkflow and blUpdateItemWorkflow. |
Money |
getRetailPrice()
Returns the Retail Price of the Sku.
|
Money |
getSalePrice()
Returns the Sale Price of the Sku.
|
Map<String,SkuAttribute> |
getSkuAttributes()
Denormalized set of key-value pairs to attach to a Sku.
|
Map<String,Media> |
getSkuMedia()
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.
|
Boolean |
getTaxable()
Convenience that passes through to isTaxable
|
String |
getTaxCode()
Returns the Tax Code for this particular Entity.
|
Weight |
getWeight()
Gets the embedded Weight for this Sku
|
boolean |
hasRetailPrice()
Provides a way of determining if a Sku has a retail price without getting an IllegalStateException.
|
boolean |
hasSalePrice()
Determines if there is a sale price.
|
boolean |
isActive()
Returns a boolean indicating whether this sku is active.
|
boolean |
isActive(Product product,
Category category)
Returns whether or not this Sku, the given Product and the given Category are all active
|
Boolean |
isAvailable()
Deprecated.
use
getInventoryType() or InventoryService.isAvailable(Sku, int) instead. |
Boolean |
isDiscountable()
Returns whether the Sku qualifies for discounts or not.
|
Boolean |
isMachineSortable()
Deprecated.
use
getIsMachineSortable() instead since that is the correct bean notation |
boolean |
isOnSale()
A product is on sale provided the sale price is not null, non-zero, and less than the retail price.
|
Boolean |
isTaxable()
Returns whether the Sku qualifies for taxes or not.
|
void |
setActiveEndDate(Date activeEndDate)
Sets the the last date that the Sku should be available for sale.
|
void |
setActiveStartDate(Date activeStartDate)
Sets the the first date that the Sku should be available for sale.
|
void |
setAvailable(Boolean available)
Deprecated.
use
setInventoryType(InventoryType) instead |
void |
setCurrency(BroadleafCurrency currency)
Sets the currency for this Sku
Note: Currency is ignored when using dynamic pricing
|
void |
setDefaultProduct(Product product)
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.
|
void |
setDescription(String description)
Sets the brief description of the Sku.
|
void |
setDimension(Dimension dimension)
Sets the embedded Dimension for this Sku
|
void |
setDiscountable(Boolean discountable)
Sets the whether the Sku qualifies for discounts or not.
|
void |
setExcludedFulfillmentOptions(List<FulfillmentOption> excludedFulfillmentOptions)
Sets the
FulfillmentOptions that this Sku should be excluded from being apart of |
void |
setFees(List<SkuFee> fees)
Sets the extra fees for this particular Sku
|
void |
setFulfillmentFlatRates(Map<FulfillmentOption,BigDecimal> fulfillmentFlatRates)
Sets the flat rates for fulfilling this
Sku for a particular FulfillmentOption. |
void |
setFulfillmentType(FulfillmentType fulfillmentType)
Sets the fulfillment type for this sku.
|
void |
setId(Long id)
Sets the id of this sku
|
void |
setInventoryType(InventoryType inventoryType)
Sets the type of inventory for this sku
|
void |
setIsMachineSortable(Boolean isMachineSortable)
Sets whether or not this Sku can be sorted by a machine
|
void |
setListPrice(Money listPrice)
Deprecated.
|
void |
setLongDescription(String longDescription)
Sets the long description of the sku.
|
void |
setMachineSortable(Boolean isMachineSortable)
Deprecated.
use
setIsMachineSortable(Boolean) instead since that is the correct bean notation |
void |
setName(String name)
Sets the the name of the Sku.
|
void |
setProduct(Product product)
Associates a Sku to a given Product.
|
void |
setProductOptionValues(List<ProductOptionValue> productOptionValues)
Deprecated.
use
setProductOptionValuesCollection(java.util.Set) instead |
void |
setProductOptionValuesCollection(Set<ProductOptionValue> productOptionValues)
Sets the ProductOptionValues that should be mapped to this Sku
|
void |
setQuantityAvailable(Integer quantityAvailable)
Used in conjunction with
InventoryType.CHECK_QUANTITY from getInventoryType(). |
void |
setRetailPrice(Money retailPrice)
Sets the retail price for the Sku.
|
void |
setSalePrice(Money salePrice)
Sets the the Sale Price of the Sku.
|
void |
setSkuAttributes(Map<String,SkuAttribute> skuAttributes)
Sets the denormalized set of key-value pairs on a Sku
|
void |
setSkuMedia(Map<String,Media> skuMedia)
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.
|
void |
setTaxable(Boolean taxable)
Sets the whether the Sku qualifies for taxes or not.
|
void |
setTaxCode(String taxCode)
Sets the tax code for this SKU
|
void |
setWeight(Weight weight)
Sets the embedded Weight for this Sku
|
Long getId()
void setId(Long id)
Money getProductOptionValueAdjustments()
ProductOptionValue}Money getSalePrice()
SkuPricingConsiderationContext is set, this uses the DynamicSkuPricingService
to calculate what this should actually be rather than use the property itselfSkuPricingConsiderationContext, DynamicSkuPricingServicevoid setSalePrice(Money salePrice)
boolean hasSalePrice()
Money getRetailPrice()
SkuPricingConsiderationContext
is set, this uses the DynamicSkuPricingService to calculate what this should actually be rather than use the property
itself.IllegalStateException - if retail price is null.SkuPricingConsiderationContext, DynamicSkuPricingService, Sku.hasRetailPrice()void setRetailPrice(Money retailPrice)
retail - price for the Skuboolean hasRetailPrice()
Sku.getRetailPrice()Money getPrice()
@Deprecated Money getListPrice()
@Deprecated void setListPrice(Money listPrice)
String getName()
void setName(String name)
String getDescription()
void setDescription(String description)
String getLongDescription()
void setLongDescription(String longDescription)
Boolean isTaxable()
Boolean getTaxable()
void setTaxable(Boolean taxable)
Boolean isDiscountable()
void setDiscountable(Boolean discountable)
@Deprecated Boolean isAvailable()
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 getInventoryType()
is set to InventoryType.CHECK_QUANTITY then this will return true.
@Deprecated Boolean getAvailable()
getInventoryType() instead#isAvailable()}@Deprecated void setAvailable(Boolean available)
setInventoryType(InventoryType) insteadDate getActiveStartDate()
void setActiveStartDate(Date activeStartDate)
Date getActiveEndDate()
void setActiveEndDate(Date activeEndDate)
Dimension getDimension()
void setDimension(Dimension dimension)
dimension - Weight getWeight()
void setWeight(Weight weight)
weight - boolean isActive()
Map<String,Media> getSkuMedia()
void setSkuMedia(Map<String,Media> skuMedia)
boolean isActive(Product product, Category category)
product - - Product that should be activecategory - - Category that should be activeproduct and category are all active
false otherwiseMap<String,SkuAttribute> getSkuAttributes()
ProductOption scenario (like colors, sizes, etc) see getProductOptionValues()
and setProductOptionValues()void setSkuAttributes(Map<String,SkuAttribute> skuAttributes)
skuAttributes - @Deprecated List<ProductOptionValue> getProductOptionValues()
getProductOptionValuesCollection() insteadProductOptionValue}, {@link ProductOption}@Deprecated void setProductOptionValues(List<ProductOptionValue> productOptionValues)
setProductOptionValuesCollection(java.util.Set) insteadproductOptionValues - ProductOptionValue}, {@link ProductOption}Set<ProductOptionValue> getProductOptionValuesCollection()
ProductOptionValue}, {@link ProductOption}void setProductOptionValuesCollection(Set<ProductOptionValue> productOptionValues)
productOptionValues - ProductOptionValue}, {@link ProductOption}Product getDefaultProduct()
getProduct()void setDefaultProduct(Product product)
setProduct(Product) or Product#setSkus(List) which would then cause this Sku to show up in the list of Skus for
the given Productproduct - Product getProduct()
getDefaultProduct() != null) than this will return 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 setProduct(Product).
Product.setDefaultSku(Sku))
as well as the @ManyToOne association set (setProduct(Product)). In this case, This method would only return
the result of 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.getDefaultProduct() if getDefaultProduct() is non-null, the @ManyToOne Product association otherwise. If no
relationship is set, returns nullvoid setProduct(Product product)
Product.getSkus()product - - Product to associate this Sku toProduct.getSkus()boolean isOnSale()
@Deprecated Boolean isMachineSortable()
getIsMachineSortable() instead since that is the correct bean notationBoolean getIsMachineSortable()
@Deprecated void setMachineSortable(Boolean isMachineSortable)
setIsMachineSortable(Boolean) instead since that is the correct bean notationisMachineSortable - void setIsMachineSortable(Boolean isMachineSortable)
isMachineSortable - List<SkuFee> getFees()
FulfillmentGroup.getFulfillmentGroupFees() for an OrderSkuFees for this Skuvoid setFees(List<SkuFee> fees)
fees - Map<FulfillmentOption,BigDecimal> getFulfillmentFlatRates()
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.Skuvoid setFulfillmentFlatRates(Map<FulfillmentOption,BigDecimal> fulfillmentFlatRates)
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.fulfillmentFlatRates - List<FulfillmentOption> getExcludedFulfillmentOptions()
FulfillmentOptions that this Sku should be excluded from. For instance,
some Skus might not be available to be fulfilled next-dayvoid setExcludedFulfillmentOptions(List<FulfillmentOption> excludedFulfillmentOptions)
FulfillmentOptions that this Sku should be excluded from being apart ofexcludedFulfillmentOptions - InventoryType getInventoryType()
InventoryType for this skuvoid setInventoryType(InventoryType inventoryType)
inventoryType - the InventoryType for this skuInteger getQuantityAvailable()
Used in conjuction with InventoryType.CHECK_QUANTITY within the blAddItemWorkflow and blUpdateItemWorkflow.
This field is checked within the CheckAvailabilityActivity to determine if inventory is actually available
for this Sku.
In order to enable this feature in a Broadleaf 3.1.1+ installation, you must hook up the QuantityAvailableSkuTemplate
to dynamically weave in the quantityAvailable field or override this method in a subclass. This is enabled out of the
box in Broadleaf 3.2+
void setQuantityAvailable(Integer quantityAvailable)
Used in conjunction with InventoryType.CHECK_QUANTITY from getInventoryType(). This sets how much
inventory is available for this Sku.
In order to enable this feature in a Broadleaf 3.1.1+ installation, you must hook up the QuantityAvailableSkuTemplate
to dynamically weave in the quantityAvailable field or override this method in a subclass. This is enabled out of the
box in Broadleaf 3.2+
quantityAvailable - the quantity available for this skuFulfillmentType getFulfillmentType()
void setFulfillmentType(FulfillmentType fulfillmentType)
fulfillmentType - void clearDynamicPrices()
void setCurrency(BroadleafCurrency currency)
currency - BroadleafCurrency getCurrency()
String getTaxCode()
void setTaxCode(String taxCode)
taxCode - Copyright © 2015. All Rights Reserved.