SilverShop\Discounts\Calculator
Synopsis
class Calculator
{
- // members
- protected $order;
- protected $discounts;
- protected $modifier;
- protected array $log = ;
- // methods
- public void __construct()
- public double calculate()
- protected float getDiscountableAmount()
- protected array discountSubtotal()
- protected array createPriceInfoList()
- protected void getItemDiscounts()
- protected void getCartDiscounts()
- protected void getShippingDiscounts()
- public void logDiscountAmount()
- public void getLog()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
Members
protected
- $discounts
- $log
- $modifier
- $order
Methods
protected
- createPriceInfoList()
- discountSubtotal() — Work out how much the given discount has already been used.
- getCartDiscounts()
- getDiscountableAmount() — Work out the total discountable amount for a given discount
- getItemDiscounts()
- getShippingDiscounts()
public
- __construct()
- calculate() — Work out the discount for a given order.
- getLog()
- logDiscountAmount() — Store details about discounts for loggging / debubgging