Skip to content

Commit

Permalink
Add notes about new param
Browse files Browse the repository at this point in the history
  • Loading branch information
arti0090 committed Jun 22, 2021
1 parent ae32ed2 commit 46a310b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 14 additions & 0 deletions UPGRADE-1.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@
}
]
```

1. Constructor of `Core/OrderProcessing/OrderTaxesProcessor.php` has been changed where new service implementing
`TaxationAddressResolverInterface` will become mandatory from Sylius version 2.0:

```diff
public function __construct(
ZoneProviderInterface $defaultTaxZoneProvider,
ZoneMatcherInterface $zoneMatcher,
PrioritizedServiceRegistryInterface $strategyRegistry,
+ ?TaxationAddressResolverInterface $taxationAddressResolver = null
) {
...
}
```
19 changes: 2 additions & 17 deletions docs/cookbook/taxation/customize-tax-by-address.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,12 @@ as from 1st July 2021 the new taxation rules will be applied.

You can learn more about new EU taxation rules `here <https://ec.europa.eu/taxation_customs/business/vat/modernising-vat-cross-border-ecommerce_en>`_.

To change the way how the taxes are calculated: by billing or by shipping address, you need to declare ``OrderTaxesProcessor`` with
additional argument in your config file:

.. code-block:: yaml
# app/config/services.yaml
App\OrderProcessing\OrderTaxesProcessor:
arguments:
- '@sylius.provider.channel_based_default_zone_provider'
- '@sylius.zone_matcher'
- '@sylius.registry.tax_calculation_strategy'
- '@sylius.taxation_address_resolver'
tags:
- { name: sylius.order_processor, priority: 10 }
And add a parameter to your config:
To change the way how the taxes are calculated: by billing or by shipping address, you need to add a parameter to your config:

.. code-block:: yaml
# app/config/packages/_sylius.yaml
parameters:
sylius_core.taxation.shipping_address_based_taxation: true
And with this change, the way how taxes are calculated is based on shipping address.
And with this change, the way how taxes are calculated is now based on shipping address.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<argument type="service" id="sylius.provider.channel_based_default_zone_provider" />
<argument type="service" id="sylius.zone_matcher" />
<argument type="service" id="sylius.registry.tax_calculation_strategy" />
<argument type="service" id="sylius.taxation_address_resolver" />
<tag name="sylius.order_processor" priority="10"/>
</service>

Expand Down

0 comments on commit 46a310b

Please sign in to comment.