Sylius: Zones unusable in real-life situations

Created on 5 Dec 2016  ยท  2Comments  ยท  Source: Sylius/Sylius

As mentioned in https://github.com/Sylius/Sylius/issues/6341 earlier on, zones do not work as expected when there is more than one zone containing the same country in it.

This is however a very standard use case : I define _shipping zones_ for shipping, and I define _tax zones_ for the tax calculations. They should be distinct โ€” except if you're only operating in the US but I doubt it's the case of everybody here.

Scopes exist in the model and are perfectly tailored for this use case, I wonder why they are not used. As a matter of fact, for us all the tax calculations are wrong because the zoneMatcher takes whatever irrelevant zone it finds first, which doesn't make any sense. Even if we correctly defined the default zone for the channel, it is never used, which is even worse.

What about adding scopes editable in the back end, and adding a very simple fix :

$zone = $this->zoneMatcher->match($shippingAddress, 'tax');

in OrderTaxesProcessor.php ? That would allow separate scopes for processing the order and would also make the default tax zone useful again.

RFC

Most helpful comment

I think it's too late for such change, it would be an irritating BC break... ๐Ÿ˜ž The solution in https://github.com/Sylius/Sylius/issues/7049 has all needed features and is almost not BC break ๐Ÿ˜„

All 2 comments

I'd be more supportive of TaxZone and ShippingZone as types and use a discriminator column in the DB to differentiate them.

I think it's too late for such change, it would be an irritating BC break... ๐Ÿ˜ž The solution in https://github.com/Sylius/Sylius/issues/7049 has all needed features and is almost not BC break ๐Ÿ˜„

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stefandoorn picture stefandoorn  ยท  3Comments

inssein picture inssein  ยท  3Comments

igormukhingmailcom picture igormukhingmailcom  ยท  3Comments

tchapi picture tchapi  ยท  3Comments

Chrysweel picture Chrysweel  ยท  3Comments