mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Merge pull request #11949 from Philiphil/patch-2
[DOC] Update calculating_taxes.rst
This commit is contained in:
commit
e6ec2e4a55
1 changed files with 4 additions and 11 deletions
|
|
@ -1,13 +1,6 @@
|
|||
.. rst-class:: outdated
|
||||
|
||||
Calculating taxes
|
||||
=================
|
||||
|
||||
.. danger::
|
||||
|
||||
We're sorry but **this documentation section is outdated**. Please have that in mind when trying to use it.
|
||||
You can help us making documentation up to date via Sylius Github. Thank you!
|
||||
|
||||
.. warning::
|
||||
|
||||
When using the CoreBundle (i.e: full stack Sylius framework), the taxes are already calculated at each cart change.
|
||||
|
|
@ -25,9 +18,9 @@ Resolving rate and using calculator
|
|||
|
||||
namespace Acme\ShopBundle\Taxation;
|
||||
|
||||
use Acme\ShopBundle\Entity\Order;
|
||||
use Sylius\Bundle\TaxationBundle\Calculator\CalculatorInterface;
|
||||
use Sylius\Bundle\TaxationBundle\Resolver\TaxRateResolverInterface;
|
||||
use Acme\ShopBundle\Entity\Order\Order;
|
||||
use Sylius\Component\Taxation\Calculator\CalculatorInterface;
|
||||
use Sylius\Component\Taxation\Resolver\TaxRateResolverInterface;
|
||||
|
||||
class TaxApplicator
|
||||
{
|
||||
|
|
@ -49,7 +42,7 @@ Resolving rate and using calculator
|
|||
$tax = 0;
|
||||
|
||||
foreach ($order->getItems() as $item) {
|
||||
$taxable = $item->getProduct();
|
||||
$taxable = $item->getVariant();
|
||||
$rate = $this->taxRateResolver->resolve($taxable);
|
||||
|
||||
if (null === $rate) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue