Allow custom tax types to be applied globally

Created on 10 January 2019, almost 6 years ago
Updated 5 February 2024, 11 months ago

We have an issue where New Zealand GST needs to be applied globally, to all orders, to comply with tax law. I suspect this is not a unique situation and might apply to many more countries too.

The problem with the custom tax plugin is that it forces you to select at least one territory. It is not really practical to set up 258 territories for every tax.

I propose a minor modification to \Drupal\commerce_tax\Plugin\Commerce\TaxType\Custom:

  • Remove the form validation that requires to your add at least one territory.
  • During buildZones(), if no territory is selected, load the country list and construct a valid array which contains every country in the CountryManager, resulting in the creation of a global TaxZone.

I understand that the custom tax type could be overridden, or that a special NZ compliant plugin could be written, but I believe it to be far more beneficial to have this working out of the box with the custom plugin, as NZ's GST is not complicated enough to warrant it's own plugin contrib module and it is likely that other countries might have very similar requirements for tax to be collected no matter where the order is coming from.

✨ Feature request
Status

Fixed

Version

2.0

Component

Tax

Created by

🇳🇿New Zealand dieuwe Auckland, NZ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024