SilverCommerce\TaxAdmin\Tests\Model\TestProduct
Synopsis
class TestProduct
extends DataObject
implements
TestOnly,TaxableProvider
{
- // members
- private static boolean $show_price_with_tax = false;
- private static boolean $show_tax_string = false;
- private static array $db = ;
- private static array $has_one = ;
- // methods
- public void getBasePrice()
- public TaxRate getTaxRate()
- public bool getShowPriceWithTax()
- public bool|null getShowTaxString()
- public string getLocale()
- // Inherited methods from Taxable
- public mixed filterTaxableExtensionResults()
- public NumberFormatter getFormatter()
- public string getCurrency()
- public string getCurrencySymbol()
- public float getNoTaxPrice()
- public float getTaxPercentage()
- public float getTaxAmount()
- public float getPriceAndTax()
- public string getTaxString()
- public string getFormattedPrice()
- public string getNicePrice()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Uses
Implements
- SilverStripe\Dev\TestOnly
- SilverCommerce\TaxAdmin\Interfaces\TaxableProvider
Members
private
- $db
- $has_one
- $show_price_with_tax
—
boolean
Default behaviour for price with tax (if current instance not set) - $show_tax_string
—
boolean
Default behaviour for adding the tax string to the rendered currency.
Methods
public
- getBasePrice()
- getLocale() — Return the currently available locale
- getShowPriceWithTax() — Get should this field automatically show the price including TAX?
- getShowTaxString() — Get if this field should add a "Tax String" (EG Includes VAT) to the rendered currency?
- getTaxRate() — Find a tax rate based on the selected ID, or revert to using the valid tax from the current category
Inherited from SilverCommerce\TaxAdmin\Traits\Taxable
public
- filterTaxableExtensionResults() — Filter the results returned by an extension
- getCurrency() — Get ISO 4217 currency code from curent locale
- getCurrencySymbol() — Get a currency symbol from the current site local
- getFormattedPrice() — Return a formatted price (based on locale)
- getFormatter() — Get currency formatter
- getNicePrice() — Get nicely formatted currency (based on current locale)
- getNoTaxPrice() — Shortcut to get the price of this product without tax
- getPriceAndTax() — Get the Total price and tax
- getTaxAmount() — Get a final tax amount for this object. You can extend this method using "UpdateTax" allowing third party modules to alter tax amounts dynamically.
- getTaxPercentage() — Get the percentage tax rate assotiated with this field
- getTaxString() — Generate a string to go with the the product price. We can overwrite the wording of this by using Silverstripes language files