Interface OptionGenerationService<P extends Product>
- All Known Implementing Classes:
DefaultOptionGenerationService
public interface OptionGenerationService<P extends Product>
Service responsible for generation a
Product's options from an
OptionTemplate or OptionTemplateGroup.
ProductOptions may be used across many Products; in such
cases, Broadleaf provides an OptionTemplate as a means to share options. Moreover, some
options are frequently used in combination with each other; thus, there are also
OptionTemplateGroups that can group multiple templates together.
"Option generation", then, is the process of adding a template or group to a product. By default,
this is done by copying the template(s) to Product.getOptions(). This allows each set of
options to be customized per product while still eliminating redundancy for users reusing the
same or similar options across many products.
- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongenerateOptions(OptionGenerationRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Generates theProduct.getOptions()based on theOptionGenerationRequest.
-
Method Details
-
generateOptions
P generateOptions(OptionGenerationRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Generates theProduct.getOptions()based on theOptionGenerationRequest.- Parameters:
request-OptionGenerationRequestwith theOptionTemplateOptionTemplateGroupto be used for generating a product's options.context- context information surrounding sandboxing and multitenant state- Returns:
- The product with newly generated options.
-