Sunnysideup\EcommerceProductVariation\Control\ProductWithVariationDecoratorController
### @@@@ START REPLACEMENT @@@@ ### WHY: automated upgrade OLD: extends Extension (ignore case) NEW: extends Extension (COMPLEX) EXP: Check for use of $this->anyVar and replace with $this->anyVar[$this->owner->ID] or consider turning the class into a trait ### @@@@ STOP REPLACEMENT @@@@ ###
Synopsis
class ProductWithVariationDecoratorController
extends Extension
{
- // members
- protected array $variationFilter = ;
- private static array $allowed_actions = ;
- private static bool $use_js_validation = true;
- // methods
- public DataList Variations()
- public Form VariationForm()
- public void addVariation()
- public ArrayList AttributeValuesPerAttributeType()
- public DataList possibleValuesForAttributeType()
- public void selectvariation()
- public void filterforvariations()
- public bool HasFilterForVariations()
Hierarchy
Extends
- SilverStripe\Core\Extension
Members
private
-
$allowed_actions
standard SS Var. - $use_js_validation
—
Sunnysideup\EcommerceProductVariation\Control\bool
tells us if Javascript should be used in validating the product variation form.
protected
- $variationFilter
—
array
array of IDs of variations that should be shown if count(array) == 0 then all of them will be shown.
Methods
public
- AttributeValuesPerAttributeType() — returns a list of VariationAttributes (e.g. colour, size) and the possible Atrribute Values for each type (e.g. RED, ORANGE, XL).
- HasFilterForVariations()
- VariationForm() — returns a form of the product if it can be purchased.
- Variations() — return the variations and apply filter if one has been set.
- addVariation()
- filterforvariations() — You can specificy one or MORE.
- possibleValuesForAttributeType()
- selectvariation() — action! this action is for selecting product variations.