PHP Class WeightShippingModifier, silvershop-core

ASSUMPTION: The total order weight can be at maximum the last item in the $shippingCosts array.
Inheritance: extends ShippingModifier
Show file Open project: burnbright/silverstripe-shop Class Usage Examples

Protected Properties

Property Type Description
$weight
$weight_cost array Should be an associative array, with the weight as key (KG) and the corresponding price as value. Can be set via Config API, eg. WeightShippingModifier: weight_cost: '0.5': 12 '1.0': 15 '2.0': 20

Public Methods

Method Description
TableTitle ( )
Weight ( ) : number Calculate the total weight of the order
value ( $subtotal ) Calculates shipping cost based on Product Weight.

Method Details

TableTitle() public method

public TableTitle ( )

Weight() public method

Calculate the total weight of the order
public Weight ( ) : number
return number

value() public method

Calculates shipping cost based on Product Weight.
public value ( $subtotal )

Property Details

$weight protected property

protected $weight

$weight_cost protected static property

Should be an associative array, with the weight as key (KG) and the corresponding price as value. Can be set via Config API, eg. WeightShippingModifier: weight_cost: '0.5': 12 '1.0': 15 '2.0': 20
protected static array $weight_cost
return array