SilverCommerce\Discounts\Extensions\EstimateExtension
Add extra fields to an estimate (to track the discount)
Synopsis
class EstimateExtension
extends DataExtension
{
- // methods
- public Discount findDiscount()
- public void hasDiscount()
- public void recalculateDiscounts()
- public void getDiscountTotal()
- public void updateTotal()
- public void updateCMSFields()
- public void onAfterWrite()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $casting
- $has_many
Methods
public
- findDiscount() — Find the specific discount object for this order
- getDiscountTotal() — get the total of all discounts applied to this estimate.
- hasDiscount() — Does the current estimate have a discount?
- onAfterWrite() — if necessary, recalculate the discount amount when estimate is saved.
- recalculateDiscounts()
- updateCMSFields() — Add discount info to an estimate
- updateTotal() — update the total price with the discount reduction.