Merge pull request #11949 from Philiphil/patch-2

[DOC] Update calculating_taxes.rst
This commit is contained in:
Łukasz Chruściel 2020-11-10 17:33:52 +01:00 committed by GitHub
commit e6ec2e4a55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {