Sunnysideup\EcommerceDiscountCoupon\Modifiers\DiscountCouponModifier
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 DiscountCouponModifier
extends OrderModifier
{
- // members
- protected $_actualDeductions;
- protected $_calculatedTotal;
- private static string $table_name = 'DiscountCouponModifier';
- private static array $db = ;
- private static array $defauls = ;
- private static array $has_one = ;
- private static bool $include_modifiers_in_subtotal = false;
- private static bool $exclude_buyable_method = 'ExcludeInDiscountCalculation';
- private static string $singular_name = 'Discount Coupon Entry';
- private static string $plural_name = 'Discount Coupon Entries';
- private static $_applicable_products_array;
- private static integer $subtotal = 0;
- // methods
- public void i18n_singular_name()
- public void i18n_plural_name()
- public FieldList getCMSFields()
- public void runUpdate()
- public void ShowForm()
- public DiscountCouponModifierForm getModifierForm()
- public array updateCouponCodeEntered()
- public void setCoupon()
- public void setCouponByID()
- public void ShowInTable()
- public void CanRemove()
- public float CartValue()
- public void getCartValue()
- public bool IsDeductable()
- public bool HideInAjaxUpdate()
- protected float LiveTableValue()
- protected bool isValidAdditional()
- protected null|DiscountCouponOption myDiscountCouponOption()
- protected array applicableProductsArray()
- protected int LiveName()
- protected float LiveSubTotalAmount()
- protected float LiveCalculatedTotal()
- protected string LiveDebugString()
- protected string LiveCouponCodeEntered()
- protected int LiveDiscountCouponOptionID()
- protected void LiveType()
Hierarchy
Extends
- Sunnysideup\Ecommerce\Model\OrderModifier
Members
private
- $_applicable_products_array
- $db
- $defauls
- $exclude_buyable_method
—
Sunnysideup\EcommerceDiscountCoupon\Modifiers\bool
If this method is present in the Buyable, the related order item will be excluded. - $has_one
—
array
standard SS Variable. - $include_modifiers_in_subtotal
—
Sunnysideup\EcommerceDiscountCoupon\Modifiers\bool
Should the discount be worked out over the the sub-total or the Total Total? - $plural_name
—
string
Standard SS Variable. - $singular_name
—
string
Standard SS Variable. - $subtotal
- $table_name
—
string
standard SS Variable.
protected
- $_actualDeductions
—
float
Used in calculations to work out how much we need. - $_calculatedTotal
Methods
protected
- LiveCalculatedTotal()
- LiveCouponCodeEntered()
- LiveDebugString()
- LiveDiscountCouponOptionID()
- LiveName()
- LiveSubTotalAmount()
- LiveTableValue()
- LiveType()
- applicableProductsArray() — returns an Array of OrderItem IDs to which the coupon applies.
- isValidAdditional() — Checks for extensions to make sure it is valid...
- myDiscountCouponOption() — returns the discount coupon, if any ...
public
- CanRemove()
- CartValue()
- HideInAjaxUpdate() — some modifiers can be hidden after an ajax update (e.g. if someone enters a discount coupon and it does not exist).
- IsDeductable()
- ShowForm() — Show the form? We always show it when there are items in the cart.
- ShowInTable()
- getCMSFields() — Standard SS Method.
- getCartValue()
- getModifierForm()
- i18n_plural_name()
- i18n_singular_name()
- runUpdate() — updates all database fields.
- setCoupon()
- setCouponByID()
- updateCouponCodeEntered()