SilverShop\Model\Modifiers\Shipping\Weight
Calculates the shipping cost of an order, by taking the products and calculating the shipping weight, based on an array set in _config
ASSUMPTION: The total order weight can be at maximum the last item
in the $shippingCosts array.
Synopsis
class Weight
extends Base
{
- // members
- private static array $weight_cost = ;
- protected integer $weight = 0;
- // methods
- public void value()
- public void getTableTitle()
- public number Weight()
- // Inherited methods from Base
- public void required()
- public void requiredBeforePlace()
- // Inherited methods from OrderModifier
- public void required()
- public $subtotal modify()
- public void value()
- public void valid()
- public void Amount()
- public void TableValue()
- public boolean Total()
- public boolean IsChargable()
- public boolean canRemove()
- // Inherited methods from OrderAttribute
- public void canCreate()
- public void canDelete()
- public void isLive()
- public string getTableTitle()
- public void getCartTitle()
- public void ShowInTable()
Hierarchy
Tasks
Line | Task |
---|---|
13 | make it optional |
Members
private
- $weight_cost
—
array
Weight to price mapping.
protected
- $weight
Methods
public
- Weight() — Calculate the total weight of the order
- getTableTitle()
- value() — Calculates shipping cost based on Product Weight.
Inherited from SilverShop\Model\Modifiers\Shipping\Base
public
Inherited from SilverShop\Model\Modifiers\OrderModifier
public
- Amount() — This function is always called to determine the amount this modifier needs to charge or deduct.
- IsChargable() — Checks if this modifier has type = Chargable
- TableValue() — Monetary to use in templates.
- Total() — Provides a modifier total that is positive or negative, depending on whether the modifier is chargable or not.
- canRemove() — Checks if the modifier can be removed.
- modify() — Modifies the incoming value by adding, subtracting or ignoring the value this modifier calculates.
- required() — Specifies whether this modifier is always required in an order.
- valid() — Check if the modifier should be in the cart.
- value() — Calculates value to store, based on incoming running total.
Inherited from SilverShop\Model\OrderAttribute
public
- ShowInTable()
- canCreate()
- canDelete()
- getCartTitle()
- getTableTitle() — Produces a title for use in templates.
- isLive()