org.broadleafcommerce.core.catalog.domain
Interface ProductOption

All Superinterfaces:
Serializable
All Known Implementing Classes:
ProductOptionImpl

public interface ProductOption
extends Serializable

A product option represents a value that is entered to specify more information about a product prior to entering into the cart.

For example, a product of type shirt might have product options of "size" and "color".

There is an inherent relationship between product options and product SKUs. A sku is meant to provide a way to override the pricing of a product for a specific set of options. Inventory can also be tracked at the SKU level.

For example, consider a shirt that is sold in 5 colors and 5 sizes. For this example, there would be 1 product. It would have 10 options (5 colors + 5 sizes). The product would have as few as 1 SKu and a many as 26 SKUs.

1 SKU would indicate that the system is not tracking inventory for the items and that all of the variations of shirt are priced the same way.

26 would indicate that there are 25 SKUs that are used to track inventory and potentially override pricing. The extra "1" sku is used to hold the default pricing.

Author:
bpolster

Method Summary
 List<ProductOptionValue> getAllowedValues()
          Gets the available values that a user can select for this ProductOption.
 String getAttributeName()
          Gets the attribute name for where the ProductOptionValue selected for this ProductOption is stored in the OrderItemAttributes for the OrderItem
 Integer getDisplayOrder()
          Gets the display order of this option in relation to the other ProductOptions
 String getErrorCode()
           
 String getErrorMessage()
           
 Long getId()
          Returns unique identifier of the product option.
 String getLabel()
          The label to show to the user when selecting from the available ProductOptionValues.
 ProductOptionValidationType getProductOptionValidationType()
           
 List<Product> getProducts()
          Gets all the Products associated with this ProductOption
 Boolean getRequired()
           
 ProductOptionType getType()
          Returns the option type.
 Boolean getUseInSkuGeneration()
           
 String getValidationString()
           
 void setAllowedValues(List<ProductOptionValue> allowedValues)
          Set the allowed values for this ProductOption
 void setAttributeName(String name)
          Sets the attribute name that will be used in storing the selected ProductOptionValue for this ProductOption
 void setDisplayOrder(Integer displayOrder)
          Gets the display order of this option in relation to the other ProductOptions
 void setErrorCode(String errorCode)
           
 void setErrorMessage(String errorMessage)
           
 void setId(Long id)
          Sets the unique identifier of the product option.
 void setLabel(String label)
          Sets the label to show the user when selecting from the available ProductOptionValues
 void setProductOptionValidationType(ProductOptionValidationType productOptionValidationType)
           
 void setProducts(List<Product> products)
          Set the Products to associate with this ProductOption
 void setRequired(Boolean required)
          Sets whether or not
 void setType(ProductOptionType type)
          Sets the option type.
 void setUseInSkuGeneration(Boolean useInSkuGeneration)
           
 void setValidationString(String validationString)
           
 

Method Detail

getId

Long getId()
Returns unique identifier of the product option.

Returns:

setId

void setId(Long id)
Sets the unique identifier of the product option.

Parameters:
id -

getType

ProductOptionType getType()
Returns the option type. For example, "color", "size", etc. These are used primarily to determine how the UI should prompt for and validate the product option.

Returns:

setType

void setType(ProductOptionType type)
Sets the option type. This is primarily used for display to render the option selection.

Parameters:
type -

getAttributeName

String getAttributeName()
Gets the attribute name for where the ProductOptionValue selected for this ProductOption is stored in the OrderItemAttributes for the OrderItem

Returns:
the name of the OrderItemAttribute to store the selected ProductOptionValue in the Order domain
See Also:
OrderItemAttribute}, {@link OrderItem}

setAttributeName

void setAttributeName(String name)
Sets the attribute name that will be used in storing the selected ProductOptionValue for this ProductOption

Parameters:
name - - the name of the OrderItemAttribute to store the selected ProductOptionValue in the Order domain

getLabel

String getLabel()
The label to show to the user when selecting from the available ProductOptionValues. This might be "Color" or "Size"

Returns:

setLabel

void setLabel(String label)
Sets the label to show the user when selecting from the available ProductOptionValues

Parameters:
label -

getRequired

Boolean getRequired()
Returns:
whether or not this ProductOption is required

setRequired

void setRequired(Boolean required)
Sets whether or not

Parameters:
required -

getDisplayOrder

Integer getDisplayOrder()
Gets the display order of this option in relation to the other ProductOptions

Returns:

setDisplayOrder

void setDisplayOrder(Integer displayOrder)
Gets the display order of this option in relation to the other ProductOptions

Parameters:
displayOrder -

getProducts

List<Product> getProducts()
Gets all the Products associated with this ProductOption

Returns:
the Products associated with this ProductOption

setProducts

void setProducts(List<Product> products)
Set the Products to associate with this ProductOption

Parameters:
products -

getAllowedValues

List<ProductOptionValue> getAllowedValues()
Gets the available values that a user can select for this ProductOption. This value will be stored in OrderItemAttributes at the OrderItem level. The OrderItemAttribute name will be whatever was returned from getAttributeName()

Returns:
the allowed values for this ProductOption

setAllowedValues

void setAllowedValues(List<ProductOptionValue> allowedValues)
Set the allowed values for this ProductOption

Parameters:
allowedValues -

getUseInSkuGeneration

Boolean getUseInSkuGeneration()

getProductOptionValidationType

ProductOptionValidationType getProductOptionValidationType()

setProductOptionValidationType

void setProductOptionValidationType(ProductOptionValidationType productOptionValidationType)

setUseInSkuGeneration

void setUseInSkuGeneration(Boolean useInSkuGeneration)

setErrorMessage

void setErrorMessage(String errorMessage)

setErrorCode

void setErrorCode(String errorCode)

getErrorMessage

String getErrorMessage()

getValidationString

String getValidationString()

setValidationString

void setValidationString(String validationString)

getErrorCode

String getErrorCode()


Copyright © 2013. All Rights Reserved.