Interface ProductOption

All Superinterfaces:
org.broadleafcommerce.common.copy.MultiTenantCloneable<ProductOption>, Serializable
All Known Implementing Classes:
ProductOptionImpl

public interface ProductOption extends Serializable, org.broadleafcommerce.common.copy.MultiTenantCloneable<ProductOption>

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 Details

    • 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 -
    • getName

      String getName()
      Returns name of the product option.
      Returns:
    • setName

      void setName(String name)
      Sets the name of the product option.
      Parameters:
      name -
    • 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
    • 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

      @Deprecated(forRemoval=true) List<Product> getProducts()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getProductXrefs instead
      Gets all the Products associated with this ProductOption
      Returns:
      the Products associated with this ProductOption
    • setProducts

      @Deprecated(forRemoval=true) void setProducts(List<Product> products)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use setProductXrefs instead
      Set the Products to associate with this ProductOption
      Parameters:
      products -
    • getProductXrefs

      List<ProductOptionXref> getProductXrefs()
    • setProductXrefs

      void setProductXrefs(List<ProductOptionXref> xrefs)
    • 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()
    • setUseInSkuGeneration

      void setUseInSkuGeneration(Boolean useInSkuGeneration)
    • getProductOptionValidationType

      ProductOptionValidationType getProductOptionValidationType()
    • setProductOptionValidationType

      void setProductOptionValidationType(ProductOptionValidationType productOptionValidationType)
    • getErrorMessage

      String getErrorMessage()
    • setErrorMessage

      void setErrorMessage(String errorMessage)
    • getValidationString

      String getValidationString()
    • setValidationString

      void setValidationString(String validationString)
    • getErrorCode

      String getErrorCode()
    • setErrorCode

      void setErrorCode(String errorCode)
    • getProductOptionValidationStrategyType

      ProductOptionValidationStrategyType getProductOptionValidationStrategyType()
    • setProductOptionValidationStrategyType

      void setProductOptionValidationStrategyType(ProductOptionValidationStrategyType productOptionValidationType)
    • getLongDescription

      String getLongDescription()
    • setLongDescription

      void setLongDescription(String longDescription)