SilverCommerce\Postage\Extensions\PostageExtension
Add extra postage options to a DataObject (for example and Invoice or Estimate)
This function will attempt to autocalculate tax for an extended object,
and will add look for the following extension hooks to update the prices:
- `updateTaxTotal` (to add the postage tax to the current tax value)
- `updateTotal` (to add the current postage price to the total value)
Synopsis
class PostageExtension
extends DataExtension
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $casting = ;
- // methods
- public PostageExtension setPostage()
- public PostageOption getPostage()
- public PostageExtension clearPostage()
- public string getPostageDetails()
- public float getPostageTotal()
- public float getPostageTaxPrice()
- public void updateTaxTotal()
- public void updateTotal()
- public void updateCMSFields()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $casting
- $db
- $has_one
Methods
public
- clearPostage() — Remove all postage settings from this object
- getPostage() — Generate a PostageOption based on this object's details
- getPostageDetails() — Generate a string outlining the details of selected postage
- getPostageTaxPrice() — Get the total value of postage (including tax)
- getPostageTotal() — Get the total value of postage (including tax)
- setPostage() — Set the postage settings on this object based on the provided PostageOption.
- updateCMSFields()
- updateTaxTotal() — Add the current postage tax top the total tax on this object
- updateTotal() — Attempt to add the postage price to current totals