Class Product
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware
,com.broadleafcommerce.money.CurrencyConsumer
,Serializable
,javax.money.CurrencySupplier
- Author:
- Phillip Verheyden (phillipuniverse)
- See Also:
-
Constructor Summary
ConstructorDescriptionProduct()
Product
(String id, String name, String uri, String description, String sku, String upc, String externalId, javax.money.CurrencyUnit currency, String pricingKey, javax.money.MonetaryAmount msrp, javax.money.MonetaryAmount defaultPrice, javax.money.MonetaryAmount salePrice, javax.money.MonetaryAmount cost, String metaTitle, String metaDescription, String displayTemplate, boolean online, boolean discountable, String inventoryType, String mergingType, boolean availableOnline, String inventoryCheckStrategy, String inventoryReservationStrategy, boolean eligibleForPickup, Map<String, FulfillmentFlatRate> fulfillmentFlatRates, Instant activeStartDate, Instant activeEndDate, Dimensions dimension, Weight weight, boolean searchable, boolean individuallySold, boolean merchandisingProduct, String productType, List<String> keywords, Map<String, Attribute> attributes, List<IncludedProduct> includedProducts, List<ProductOption> options, ReviewsSummary reviewsSummary, ProductAsset primaryAsset, Category primaryCategory, List<String> tags, DataDrivenEnum brand, DataDrivenEnum merchandisingType, DataDrivenEnum targetDemographic, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState, String taxCode, Integer minimumThreshold, Integer maximumThreshold, Variant defaultVariant) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
End when this product is not longer active.Start of when this product should be active.<T> T
getAttribute
(String name) Dynamic attributes that are a part of the product.getBrand()
com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.javax.money.MonetaryAmount
getCost()
Can be used in display or as a part of more complex pricing algorithms.javax.money.CurrencyUnit
Currency for all of the prices on this productjavax.money.MonetaryAmount
The default price that should be used if there is not asalePrice
set.When the `productType` is `VARIANT_BASED` this represents the default.Description of the product that can include HTML in implementations where a WYSIWYG editor manages this field.Defines the display template.This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping).getId()
Additional products that are always included with the product, no matter what.Describes when the product's inventory should be checked for availability.Describes when the product's inventory should be reserved.Describes the product's type of fulfillment - ie is it a physical or virtual item?Generally additional search terms that should be used when customers search for this product.The maximum count of this product that must be added in a cart.Determines how this Product should merge with other similar items when it gets added to a cart.Used for SEO data in<meta description="">
in a product detail page.Used for SEO data in<title>
tag in a product detail page.The minimum count of this product that must be added in a cart.javax.money.MonetaryAmount
getMsrp()
Suggested retail price for the product.getName()
Customer-facing name of this product.Drives additional information that the customer should enter when purchasing this product.javax.money.MonetaryAmount
Calculates the total with theincludedProducts
andDefaultProductOptionType.ITEM_CHOICE
typeoptions
that haveItemChoice.getMinimumQuantity()
greater than 0.System-wide unique identifier to configure specific pricing for the product.TheProductAsset
associated with this product marked asProductAsset.isPrimary()
.TheCategory
associated with this product where theCategoryProduct
relationship is marked asCategoryProduct.isPrimary()
.Defines the type of the product.Thesummary of reviews
for this product.javax.money.MonetaryAmount
Indicates that this product is on sale.getSku()
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.getTags()
A list of simple labels used to categorize the productThe tax code for this product.getUpc()
Universal product code that identifies this product.getUri()
SEO-friendly URI to identify this product.int
hashCode()
boolean
isActive()
Inactive products are by default searchable and browseable but are not purchaseableboolean
Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.boolean
Whether or not this product be applied to any offers or promotions.boolean
Whether or not this Product can be picked up at a store rather than just be shippedboolean
If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on.boolean
Deprecated.boolean
isOnline()
Whether or not this product should be visible at all in the store.boolean
isOnSale()
An item is on sale if bothgetDefaultPrice()
andgetSalePrice()
are both set andgetSalePrice()
is less than thedefaultPrice
boolean
Whether or not this product shows up in search.void
setActiveEndDate
(Instant activeEndDate) End when this product is not longer active.void
setActiveStartDate
(Instant activeStartDate) Start of when this product should be active.void
setAttributes
(Map<String, Attribute> attributes) Dynamic attributes that are a part of the product.void
setAvailableOnline
(boolean availableOnline) Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.void
setBrand
(DataDrivenEnum brand) void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
setCost
(javax.money.MonetaryAmount cost) Can be used in display or as a part of more complex pricing algorithms.void
setCurrency
(javax.money.CurrencyUnit currency) Currency for all of the prices on this productvoid
setDefaultPrice
(javax.money.MonetaryAmount defaultPrice) The default price that should be used if there is not asalePrice
set.void
setDefaultVariant
(Variant defaultVariant) When the `productType` is `VARIANT_BASED` this represents the default.void
setDescription
(String description) Description of the product that can include HTML in implementations where a WYSIWYG editor manages this field.void
setDimension
(Dimensions dimension) void
setDiscountable
(boolean discountable) Whether or not this product be applied to any offers or promotions.void
setDisplayTemplate
(String displayTemplate) Defines the display template.void
setEligibleForPickup
(boolean eligibleForPickup) Whether or not this Product can be picked up at a store rather than just be shippedvoid
setExternalId
(String externalId) This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.void
setFulfillmentFlatRates
(Map<String, FulfillmentFlatRate> fulfillmentFlatRates) A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping).void
void
setIncludedProducts
(List<IncludedProduct> includedProducts) Additional products that are always included with the product, no matter what.void
setIndividuallySold
(boolean individuallySold) If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on.void
setInventoryCheckStrategy
(String inventoryCheckStrategy) Describes when the product's inventory should be checked for availability.void
setInventoryReservationStrategy
(String inventoryReservationStrategy) Describes when the product's inventory should be reserved.void
setInventoryType
(String inventoryType) Describes the product's type of fulfillment - ie is it a physical or virtual item?void
setKeywords
(List<String> keywords) Generally additional search terms that should be used when customers search for this product.void
setMaximumThreshold
(Integer maximumThreshold) The maximum count of this product that must be added in a cart.void
setMerchandisingProduct
(boolean merchandisingProduct) Deprecated.please useproductType
instead.void
setMerchandisingType
(DataDrivenEnum merchandisingType) void
setMergingType
(String mergingType) Determines how this Product should merge with other similar items when it gets added to a cart.void
setMetaDescription
(String metaDescription) Used for SEO data in<meta description="">
in a product detail page.void
setMetaTitle
(String metaTitle) Used for SEO data in<title>
tag in a product detail page.void
setMinimumThreshold
(Integer minimumThreshold) The minimum count of this product that must be added in a cart.void
setMsrp
(javax.money.MonetaryAmount msrp) Suggested retail price for the product.void
Customer-facing name of this product.void
setOnline
(boolean online) Whether or not this product should be visible at all in the store.void
setOptions
(List<ProductOption> options) Drives additional information that the customer should enter when purchasing this product.void
setPricingKey
(String pricingKey) System-wide unique identifier to configure specific pricing for the product.void
setPrimaryAsset
(ProductAsset primaryAsset) TheProductAsset
associated with this product marked asProductAsset.isPrimary()
.void
setPrimaryCategory
(Category primaryCategory) TheCategory
associated with this product where theCategoryProduct
relationship is marked asCategoryProduct.isPrimary()
.void
setProductType
(String productType) Defines the type of the product.void
setReviewsSummary
(ReviewsSummary reviewsSummary) Thesummary of reviews
for this product.void
setSalePrice
(javax.money.MonetaryAmount salePrice) Indicates that this product is on sale.void
setSearchable
(boolean searchable) Whether or not this product shows up in search.void
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.void
A list of simple labels used to categorize the productvoid
setTargetDemographic
(DataDrivenEnum targetDemographic) void
setTaxCode
(String taxCode) The tax code for this product.void
Universal product code that identifies this product.void
SEO-friendly URI to identify this product.void
toString()
-
Constructor Details
-
Product
public Product() -
Product
public Product(String id, String name, String uri, String description, String sku, String upc, String externalId, javax.money.CurrencyUnit currency, String pricingKey, javax.money.MonetaryAmount msrp, javax.money.MonetaryAmount defaultPrice, javax.money.MonetaryAmount salePrice, javax.money.MonetaryAmount cost, String metaTitle, String metaDescription, String displayTemplate, boolean online, boolean discountable, String inventoryType, String mergingType, boolean availableOnline, String inventoryCheckStrategy, String inventoryReservationStrategy, boolean eligibleForPickup, Map<String, FulfillmentFlatRate> fulfillmentFlatRates, Instant activeStartDate, Instant activeEndDate, Dimensions dimension, Weight weight, boolean searchable, boolean individuallySold, boolean merchandisingProduct, String productType, List<String> keywords, Map<String, Attribute> attributes, List<IncludedProduct> includedProducts, List<ProductOption> options, ReviewsSummary reviewsSummary, ProductAsset primaryAsset, @Nullable Category primaryCategory, List<String> tags, @Nullable DataDrivenEnum brand, @Nullable DataDrivenEnum merchandisingType, @Nullable DataDrivenEnum targetDemographic, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState, String taxCode, Integer minimumThreshold, Integer maximumThreshold, Variant defaultVariant)
-
-
Method Details
-
getAttribute
-
isActive
public boolean isActive()Inactive products are by default searchable and browseable but are not purchaseable- Returns:
- the active state of this current product
- See Also:
-
isOnSale
public boolean isOnSale()An item is on sale if bothgetDefaultPrice()
andgetSalePrice()
are both set andgetSalePrice()
is less than thedefaultPrice
- Returns:
- whether or not the item is on sale
-
getPriceWithDependentItems
public javax.money.MonetaryAmount getPriceWithDependentItems()Calculates the total with theincludedProducts
andDefaultProductOptionType.ITEM_CHOICE
typeoptions
that haveItemChoice.getMinimumQuantity()
greater than 0.- Returns:
- sum of IncludedProducts' and ItemChoices' prices.
-
getId
- Returns:
- the context ID of the product
-
getName
Customer-facing name of this product. This can also be overridden at theVariant
level- Returns:
- the display name of this product
-
getUri
SEO-friendly URI to identify this product. This is usually generated with some URL-safe version of the main category name along with a url-friendly version ofname
- Returns:
- the URI used to refer to this Product
-
getDescription
Description of the product that can include HTML in implementations where a WYSIWYG editor manages this field.- Returns:
- the description of this Product, can contain HTML
-
getSku
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.- Returns:
- the Stock Keeping Unit identifier which means that this Product is sold in the store
-
getUpc
Universal product code that identifies this product. This is usually only relevant when this product is sold individually without any variants- Returns:
- the the Universal Product Code associated with this Product
-
getExternalId
This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.- Returns:
- an external ID
-
getCurrency
public javax.money.CurrencyUnit getCurrency()Currency for all of the prices on this product- Specified by:
getCurrency
in interfacejavax.money.CurrencySupplier
- Returns:
- the currency to use for all of the prices on this product
-
getPricingKey
System-wide unique identifier to configure specific pricing for the product. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Returns:
- a unique key to identify this product
-
getMsrp
public javax.money.MonetaryAmount getMsrp()Suggested retail price for the product. This is generally only used for display and should not have any true pricing logic tied to it.- Returns:
- the suggested retail price
- See Also:
-
currency
-
getDefaultPrice
public javax.money.MonetaryAmount getDefaultPrice()The default price that should be used if there is not a
salePrice
set. This price can also be used as the default price for all of the Variants as well.For more advance pricing calculations, consider hiding this field in the API and removing support for it in lieu of managing prices outside of this service.
Always included in the API even if set to null to indicate whether or not this was explicitly set
- Returns:
- the default price of the Product, non-null only in scenarios where this Product is
intended to be sold in the store. Set to
null
if managing prices at the Variant level
-
getSalePrice
public javax.money.MonetaryAmount getSalePrice()Indicates that this product is on sale. This should take priority over the default price if this salePrice is lower than the defaultPrice.- Returns:
- the sale price, indicating that the product is on sale
-
getCost
public javax.money.MonetaryAmount getCost()Can be used in display or as a part of more complex pricing algorithms.- Returns:
- the cost of this product
-
getMetaTitle
Used for SEO data in<title>
tag in a product detail page. If this is unset, thename
should be used.- Returns:
- the meta title used for SEO data in product details page title
-
getMetaDescription
Used for SEO data in<meta description="">
in a product detail page. If this is unset, thedescription
should be used- Returns:
- the meta description used for SEO data in product details page description
-
getDisplayTemplate
Defines the display template. The display template can be used to help create a unique key that drives the presentation layer destination for this category. For example, if using Spring MVC with Thymeleaf, this could be a path to a Thymeleaf template. If using a frontend view technology like React, this could point to a specific React component.- Returns:
- the display template to use for this product
-
isOnline
public boolean isOnline()Whether or not this product should be visible at all in the store. A product that is offline is not searchable, visible, or purchasable.
Defaults to
true
- Returns:
- whether or not this product is visible in the store
-
isDiscountable
public boolean isDiscountable()Whether or not this product be applied to any offers or promotions.
Defaults to
true
- Returns:
- whether or not this product can be applied to any offers or promotions
-
getInventoryType
Describes the product's type of fulfillment - ie is it a physical or virtual item?Defaults to
InventoryType.PHYSICAL
- Returns:
- the product's type of inventory
- See Also:
-
getMergingType
Determines how this Product should merge with other similar items when it gets added to a cart. This will override the global setting on item merging. Out of box supported values are those inDefaultMergingType
.- Returns:
- the merging type to use for this Product
-
isAvailableOnline
public boolean isAvailableOnline()Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.Defaults to
true
- Returns:
- Whether or not this product is available online.
-
getInventoryCheckStrategy
Describes when the product's inventory should be checked for availability.- Returns:
- the product's inventory check strategy
- See Also:
-
getInventoryReservationStrategy
Describes when the product's inventory should be reserved.- Returns:
- the product's inventory reservation strategy
- See Also:
-
isEligibleForPickup
public boolean isEligibleForPickup()Whether or not this Product can be picked up at a store rather than just be shipped- Returns:
- if this Product can be picked up at a store
-
getFulfillmentFlatRates
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping). Depending on if the option is configured to use flat rates, this flat rate will be used in calculating the cost of fulfilling this product.The key of the map is the type of the fulfillment option such as
FIXED_STANDARD
orBANDED_PRICE_EXPRESS
.- Returns:
- Map of Fulfillment option types to flat rates for this product.
- See Also:
-
getActiveStartDate
Start of when this product should be active.- Returns:
- the date when this product should start being active
-
getActiveEndDate
End when this product is not longer active. Unset indicates that it is always active.- Returns:
- the date when this product should no longer be active
- See Also:
-
getDimension
- Returns:
- the dimensions of this product
-
getWeight
- Returns:
- the weight of this product
-
isSearchable
public boolean isSearchable()Whether or not this product shows up in search. Usually this matches whether or not the product is
individuallySold
This defaults to
true
- Returns:
- whether or not this product shows up in search
-
isIndividuallySold
public boolean isIndividuallySold()If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on. Usually if a product is not individually sold then it should also not show up in search.
This defaults to
true
.- Returns:
- whether or not this product or any of its variants can be sold individually
- See Also:
-
searchable
-
isMerchandisingProduct
Deprecated.please useproductType
instead.This product is not sold itself, but is a sort of container for subordinate items. This allows for configurable products with different user choices throughProductOption
- Returns:
- true if this product is a shell container or false otherwise
-
getProductType
Defines the type of the product. This affects how the product is displayed and managed in the admin UI, how it is handled by cart and order operations, and how it gets indexed by Search Services. The default types are defined byDefaultProductType
.- Returns:
- The type of the product
- See Also:
-
getKeywords
Generally additional search terms that should be used when customers search for this product.- Returns:
- additional search terms that should be used when customers search for this product
-
getAttributes
Dynamic attributes that are a part of the product. This is an admin-centered concept- Returns:
- dynamic attributes that are a part of the product
-
getIncludedProducts
Additional products that are always included with the product, no matter what. Used to configure "bundles" or "kits".
If some of these items should be optional or the user should decide which additional items are added to their cart, use
options
instead.- Returns:
- additional products that bundle with this product as their parent
- See Also:
-
getOptions
Drives additional information that the customer should enter when purchasing this product. This can be in the form of additionalvariations
, additional items that can be bundled with this product or simply more information that the customer needs to enter about what they are purchasing (like a personalized message).- Returns:
- different options that the user can configure to further refine their purchase.
-
getReviewsSummary
Thesummary of reviews
for this product.- Returns:
- The
summary of reviews
for this product.
-
getPrimaryAsset
TheProductAsset
associated with this product marked asProductAsset.isPrimary()
. By default, this is only hydrated for API callers.- Returns:
- The primary
ProductAsset
for this product.
-
getPrimaryCategory
TheCategory
associated with this product where theCategoryProduct
relationship is marked asCategoryProduct.isPrimary()
.This field is not persisted on the product - instead, this is a dynamically set/hydrated value for API callers to conveniently manage the primary
CategoryProduct
relationship as part ofProduct
API create/replace calls.It is not necessarily respected or hydrated in all scenarios.
- Returns:
- the category that is associated with this product as the primary category
- See Also:
-
getTags
A list of simple labels used to categorize the product- Returns:
- a list of simple labels used to categorize the product
-
getBrand
- Returns:
- the brand of this product
-
getMerchandisingType
- Returns:
- the merchandising type of this product
-
getTargetDemographic
- Returns:
- the target demographic of this product
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
getTaxCode
The tax code for this product.- Returns:
- The tax code for this product.
-
getMinimumThreshold
The minimum count of this product that must be added in a cart.- Returns:
- the minimum count of this product that must be added in a cart
-
getMaximumThreshold
The maximum count of this product that must be added in a cart.- Returns:
- the maximum count of this product that must be added in a cart
-
getDefaultVariant
When the `productType` is `VARIANT_BASED` this represents the default. -
setId
- Parameters:
id
- the context ID of the product
-
setName
Customer-facing name of this product. This can also be overridden at theVariant
level- Parameters:
name
- the name of this product suitable for display
-
setUri
SEO-friendly URI to identify this product. This is usually generated with some URL-safe version of the main category name along with a url-friendly version ofname
- Parameters:
uri
- the uniquely identifiable URI of this Product
-
setDescription
Description of the product that can include HTML in implementations where a WYSIWYG editor manages this field.- Parameters:
description
- of this Product with HTML if necessary
-
setSku
This uniquely identifies this product in the catalog when it is sold and is used for other contexts like inventory and pricing.- Parameters:
sku
- the Stock Keeping Unit identifier for this Product. Typically only set this if intending to sell this single Product in the store, but can also be set to the same value as a relatedvariant's
sku to declare a default variant/default sku for the product
-
setUpc
Universal product code that identifies this product. This is usually only relevant when this product is sold individually without any variants- Parameters:
upc
- a Universal Product Code to describe this Product
-
setExternalId
This is an arbitrary ID, typically assigned by or used by 1st or 3rd party systems that are not Broadleaf.- Parameters:
externalId
- an external ID, often a DB or business ID, from a system outside of Broadleaf
-
setCurrency
public void setCurrency(javax.money.CurrencyUnit currency) Currency for all of the prices on this product- Specified by:
setCurrency
in interfacecom.broadleafcommerce.money.CurrencyConsumer
- Parameters:
currency
- the currency to use for all of the prices on this product
-
setPricingKey
System-wide unique identifier to configure specific pricing for the product. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.- Parameters:
pricingKey
- a unique key to identify this product (usually a UUID)
-
setMsrp
public void setMsrp(javax.money.MonetaryAmount msrp) Suggested retail price for the product. This is generally only used for display and should not have any true pricing logic tied to it.- Parameters:
msrp
- what to display as the suggested retail price- See Also:
-
currency
-
setDefaultPrice
public void setDefaultPrice(javax.money.MonetaryAmount defaultPrice) The default price that should be used if there is not a
salePrice
set. This price can also be used as the default price for all of the Variants as well.For more advance pricing calculations, consider hiding this field in the API and removing support for it in lieu of managing prices outside of this service.
Always included in the API even if set to null to indicate whether or not this was explicitly set
- Parameters:
defaultPrice
- the main price used for this particular Product, only applicable if sellable in the store
-
setSalePrice
public void setSalePrice(javax.money.MonetaryAmount salePrice) Indicates that this product is on sale. This should take priority over the default price if this salePrice is lower than the defaultPrice.- Parameters:
salePrice
- the sale price, indicating that the product is on sale
-
setCost
public void setCost(javax.money.MonetaryAmount cost) Can be used in display or as a part of more complex pricing algorithms.- Parameters:
cost
- the cost of this product
-
setMetaTitle
Used for SEO data in<title>
tag in a product detail page. If this is unset, thename
should be used.- Parameters:
metaTitle
- the meta title used for SEO data in product details page title
-
setMetaDescription
Used for SEO data in<meta description="">
in a product detail page. If this is unset, thedescription
should be used- Parameters:
metaDescription
- the meta description used for SEO data in product details page description
-
setDisplayTemplate
Defines the display template. The display template can be used to help create a unique key that drives the presentation layer destination for this category. For example, if using Spring MVC with Thymeleaf, this could be a path to a Thymeleaf template. If using a frontend view technology like React, this could point to a specific React component.- Parameters:
displayTemplate
- the display template to use for this product
-
setOnline
public void setOnline(boolean online) Whether or not this product should be visible at all in the store. A product that is offline is not searchable, visible, or purchasable.
Defaults to
true
- Parameters:
online
- whether or not this product is visible in the store
-
setDiscountable
public void setDiscountable(boolean discountable) Whether or not this product be applied to any offers or promotions.
Defaults to
true
- Parameters:
discountable
- whether or not this product can be applied to any offers or promotions
-
setInventoryType
Describes the product's type of fulfillment - ie is it a physical or virtual item?Defaults to
InventoryType.PHYSICAL
- Parameters:
inventoryType
- a String representation ofInventoryType
- See Also:
-
setMergingType
Determines how this Product should merge with other similar items when it gets added to a cart. This will override the global setting on item merging. Out of box supported values are those inDefaultMergingType
.- Parameters:
mergingType
- the merging type to use for this Product
-
setAvailableOnline
public void setAvailableOnline(boolean availableOnline) Whether or not this product is available online - ie inventory is available somewhere to fulfill this product.Defaults to
true
- Parameters:
availableOnline
- Whether or not this product is available online.
-
setInventoryCheckStrategy
Describes when the product's inventory should be checked for availability.- Parameters:
inventoryCheckStrategy
- a String representation ofInventoryCheckStrategy
- See Also:
-
setInventoryReservationStrategy
Describes when the product's inventory should be reserved.- Parameters:
inventoryReservationStrategy
- a String representation ofInventoryReservationStrategy
- See Also:
-
setEligibleForPickup
public void setEligibleForPickup(boolean eligibleForPickup) Whether or not this Product can be picked up at a store rather than just be shipped- Parameters:
eligibleForPickup
- flag that denotes whether or not this product can be picked up, only applicable forInventoryType.PHYSICAL
items
-
setFulfillmentFlatRates
A map of flat rates for fulfilling (e.g., shipping) this product for a particular fulfillment option type (e.g., standard shipping). Depending on if the option is configured to use flat rates, this flat rate will be used in calculating the cost of fulfilling this product.The key of the map is the type of the fulfillment option such as
FIXED_STANDARD
orBANDED_PRICE_EXPRESS
.- Parameters:
fulfillmentFlatRates
- Map of Fulfillment option types to flat rates for this product.- See Also:
-
setActiveStartDate
Start of when this product should be active.- Parameters:
activeStartDate
- the date when this product should start being active
-
setActiveEndDate
End when this product is not longer active. Unset indicates that it is always active.- Parameters:
activeEndDate
- the date when this product should no longer be active- See Also:
-
setDimension
- Parameters:
dimension
- the dimensions of this product
-
setWeight
- Parameters:
weight
- the weight of this product
-
setSearchable
public void setSearchable(boolean searchable) Whether or not this product shows up in search. Usually this matches whether or not the product is
individuallySold
This defaults to
true
- Parameters:
searchable
- whether or not this product shows up in search
-
setIndividuallySold
public void setIndividuallySold(boolean individuallySold) If this product or any of its variants can be sold individually in the store, or if they must be apart of another product as an add-on. Usually if a product is not individually sold then it should also not show up in search.
This defaults to
true
.- Parameters:
individuallySold
- whether or not this product or any of its variants can be sold individually- See Also:
-
searchable
-
setMerchandisingProduct
Deprecated.please useproductType
instead.This product is not sold itself, but is a sort of container for subordinate items. This allows for configurable products with different user choices throughProductOption
- Parameters:
merchandisingProduct
- whether or not this is a container, merchandised-only product
-
setProductType
Defines the type of the product. This affects how the product is displayed and managed in the admin UI, how it is handled by cart and order operations, and how it gets indexed by Search Services. The default types are defined byDefaultProductType
.- Parameters:
productType
- The type of the product- See Also:
-
setKeywords
Generally additional search terms that should be used when customers search for this product.- Parameters:
keywords
- additional search terms that should be used when customers search for this product
-
setAttributes
Dynamic attributes that are a part of the product. This is an admin-centered concept- Parameters:
attributes
- dynamic attributes that are a part of the product
-
setIncludedProducts
Additional products that are always included with the product, no matter what. Used to configure "bundles" or "kits".
If some of these items should be optional or the user should decide which additional items are added to their cart, use
options
instead.- Parameters:
includedProducts
- that bundle with this product as their parent- See Also:
-
setOptions
Drives additional information that the customer should enter when purchasing this product. This can be in the form of additionalvariations
, additional items that can be bundled with this product or simply more information that the customer needs to enter about what they are purchasing (like a personalized message).- Parameters:
options
- the options for this product
-
setReviewsSummary
Thesummary of reviews
for this product.- Parameters:
reviewsSummary
- Thesummary of reviews
for this product.
-
setPrimaryAsset
TheProductAsset
associated with this product marked asProductAsset.isPrimary()
. By default, this is only hydrated for API callers.- Parameters:
primaryAsset
- The primaryProductAsset
for this product.
-
setPrimaryCategory
TheCategory
associated with this product where theCategoryProduct
relationship is marked asCategoryProduct.isPrimary()
.This field is not persisted on the product - instead, this is a dynamically set/hydrated value for API callers to conveniently manage the primary
CategoryProduct
relationship as part ofProduct
API create/replace calls.It is not necessarily respected or hydrated in all scenarios.
- Parameters:
primaryCategory
- the category that should be associated with this product as the primary category- See Also:
-
setTags
A list of simple labels used to categorize the product- Parameters:
tags
- a list of simple labels used to categorize the product
-
setBrand
- Parameters:
brand
- the brand of this product
-
setMerchandisingType
- Parameters:
merchandisingType
- the merchandising type of this product
-
setTargetDemographic
- Parameters:
targetDemographic
- the target demographic of this product
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
setTaxCode
The tax code for this product.- Parameters:
taxCode
- The tax code for this product.
-
setMinimumThreshold
The minimum count of this product that must be added in a cart.- Parameters:
minimumThreshold
- the minimum count of this product that must be added in a cart
-
setMaximumThreshold
The maximum count of this product that must be added in a cart.- Parameters:
maximumThreshold
- the maximum count of this product that must be added in a cart
-
setDefaultVariant
When the `productType` is `VARIANT_BASED` this represents the default. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
productType
instead.