mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[Documentation] Add info about new decimal tax calculator to docs
This commit is contained in:
parent
1cdca39e5c
commit
b3caf45aa4
1 changed files with 15 additions and 2 deletions
|
|
@ -145,11 +145,24 @@ which has the services that implement the `OrderTaxesApplicatorInterface <https:
|
|||
Calculators
|
||||
'''''''''''
|
||||
|
||||
For calculating Taxes **Sylius** is using the `DefaultCalculator <https://github.com/Sylius/Sylius/blob/master/src/Sylius/Component/Taxation/Calculator/DefaultCalculator.php>`_.
|
||||
For calculating Taxes **Sylius** is using tax calculators.
|
||||
|
||||
To select a proper service we have a one that decides for us
|
||||
- the `DelegatingCalculator <https://github.com/Sylius/Sylius/blob/{current_version}/src/Sylius/Component/Taxation/Calculator/DelegatingCalculator.php>`_.
|
||||
Basing on the **TaxRate** assigned on the Product it will get its calculator type calculate the amount properly.
|
||||
|
||||
You can create your custom calculator for taxes by creating a class that implements
|
||||
the `CalculatorInterface <https://github.com/Sylius/Sylius/blob/master/src/Sylius/Component/Taxation/Calculator/CalculatorInterface.php>`_
|
||||
the `CalculatorInterface <https://github.com/Sylius/Sylius/blob/{current_version}/src/Sylius/Component/Taxation/Calculator/CalculatorInterface.php>`_
|
||||
and registering it as a ``sylius.tax_calculator.your_calculator_name`` service.
|
||||
|
||||
Built-in Calculators
|
||||
''''''''''''''''''''
|
||||
|
||||
The already defined calculators in Sylius:
|
||||
|
||||
* **DefaultCalculator** - calculates the ``amount`` with rounding.
|
||||
* **DecimalCalculator** - calculates the ``amount`` without rounding, which results in a distribution of decimal values among the items.
|
||||
|
||||
Learn more
|
||||
----------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue