Sunnysideup\EcommerceDelivery\Modifiers\PickUpOrDeliveryModifier
It lets you set fixed shipping costs, or a fixed cost for each region you're delivering to.
- Author: Nicolaas [at] sunnysideup.co.nz
Synopsis
class PickUpOrDeliveryModifier
extends OrderModifier
{
- // members
- protected string $debugMessage = '';
- private static string $table_name = 'PickUpOrDeliveryModifier';
- private static array $db = ;
- private static array $defaults = ;
- private static array $has_one = ;
- private static string $singular_name = 'Pickup / Delivery Charge';
- private static string $plural_name = 'Pickup / Delivery Charges';
- private static boolean $include_form_in_order_table = true;
- private static boolean $use_dropdown_field = false;
- private static string $weight_field = 'Weight';
- private static $_total_weight;
- private static DataList $available_options;
- private static PickUpOrDeliveryModifierOptions $selected_option;
- private static integer $_actual_charges = 0;
- private static bool $calculations_done = false;
- // methods
- public void i18n_singular_name()
- public void i18n_plural_name()
- public void getCMSFields()
- public void setOption()
- public void runUpdate()
- public void ShowForm()
- public void ShowFormInEditableOrderTable()
- public Form getModifierForm()
- public void ShowInTable()
- public bool CanBeRemoved()
- public void CartValue()
- public void getCartValue()
- public void IsChargeable()
- public void requireDefaultRecords()
- public array updateForAjax()
- protected PickUpOrDeliveryModifierOptions; LiveOptionObject()
- protected bool useWeight()
- protected DataList LiveOptions()
- protected void LiveType()
- protected int LiveOptionID()
- protected string LiveName()
- protected float LiveSubTotalAmount()
- protected null|PickUpOrDeliveryModifierOptions LiveSerializedCalculationObject()
- protected void LiveRegionAndCountry()
- protected float LiveCalculatedTotal()
- protected float LiveTotalWeight()
- protected string LiveDebugString()
Hierarchy
Extends
- Sunnysideup\Ecommerce\Model\OrderModifier
Members
private
- $_actual_charges — float
- $_total_weight — float
- $available_options — SilverStripe\ORM\DataList
- $calculations_done — Sunnysideup\EcommerceDelivery\Modifiers\bool
- $db
- $defaults
- $has_one
- $include_form_in_order_table
- $plural_name
- $selected_option — Sunnysideup\EcommerceDelivery\Model\PickUpOrDeliveryModifierOptions
- $singular_name
- $table_name
- $use_dropdown_field
- $weight_field — string
protected
- $debugMessage — string
Methods
protected
- LiveCalculatedTotal()
- LiveDebugString() — returns an explanation of cost.
- LiveName()
- LiveOptionID() — Precondition : There are always options available.
- LiveOptionObject() — returns the current selected option as object.
- LiveOptions() — Returns the available delivery options based on the current country and region for the order.
- LiveRegionAndCountry() — description of region and country being shipped to.
- LiveSerializedCalculationObject() — description of region and country being shipped to.
- LiveSubTotalAmount() — cached in Order, no need to cache here.
- LiveTotalWeight()
- LiveType()
- useWeight() — works out if Weight is applicable at all.
public
- CanBeRemoved()
- CartValue() — NOTE: the function below is HACK and needs fixing proper.
- IsChargeable()
- ShowForm() — standard Modifier Method.
- ShowFormInEditableOrderTable() — Should the form be included in the editable form on the checkout page?
- ShowInTable()
- getCMSFields()
- getCartValue()
- getModifierForm()
- i18n_plural_name()
- i18n_singular_name()
- requireDefaultRecords()
- runUpdate() — updates database fields.
- setOption() — set the selected option (selected by user using form).
- updateForAjax()