PHP Class ProductVariationsExtension, silvershop-core

Inheritance: extends DataExtension
Mostrar archivo Open project: burnbright/silverstripe-shop

Public Methods

Method Description
PriceRange ( )
contentcontrollerInit ( $controller )
generateVariationsFromAttributes ( ProductAttributeType $attributetype, array $values ) Generates variations based on selected attributes.
getVariationByAttributes ( array $attributes ) : null Pass an array of attribute ids to query for the appropriate variation.
onAfterDelete ( ) Make sure variations are deleted with product.
possibleValuesForAttributeType ( $type ) : DataList Get all the {@link ProductAttributeValue} for a given attribute type, based on this product's variations.
updateCMSFields ( FieldList $fields ) Adds variations specific fields to the CMS.

Method Details

PriceRange() public method

public PriceRange ( )

contentcontrollerInit() public method

public contentcontrollerInit ( $controller )

generateVariationsFromAttributes() public method

Generates variations based on selected attributes.
public generateVariationsFromAttributes ( ProductAttributeType $attributetype, array $values )
$attributetype ProductAttributeType
$values array

getVariationByAttributes() public method

Pass an array of attribute ids to query for the appropriate variation.
public getVariationByAttributes ( array $attributes ) : null
$attributes array
return null

onAfterDelete() public method

Make sure variations are deleted with product.
public onAfterDelete ( )

possibleValuesForAttributeType() public method

Get all the {@link ProductAttributeValue} for a given attribute type, based on this product's variations.
public possibleValuesForAttributeType ( $type ) : DataList
return DataList

updateCMSFields() public method

Adds variations specific fields to the CMS.
public updateCMSFields ( FieldList $fields )
$fields FieldList