Automattic / Automattic/woocommerce-services

Enabling automated tax deletes all stored tax rates

Open
#2,471 4 comments 0 reactions 0 assignees View on GitHub
[Pri] Low [Status] Needs Discussion [Type] Enhancement woocommerce-services
Dominant language
JavaScript
Stars
112
Forks
35
Avg merge
3d 1h
Merged PRs (30d)
14

Description

This issue was discovered on support due to a user being unable to set their tax rates. 4283940-zen

## Summary

When changing the `Automated taxes` setting from `Disable automated taxes` to `Enable automated taxes`, previously entered tax rates are deleted without warning.
Automated taxes setting

## Repro

1. Create a store and check `Enable tax rates and calculations` in `Settings > General`
2. In `Settings > Tax > Tax options`, set `Disable automated taxes` and save
3. In `Standard rates`, Import the [CSV of sample tax rates](https://docs.woocommerce.com/wp-content/uploads/2013/02/us_tax_rates.csv)
4. In `Tax options`, set `Enable automated taxes` and save
5. Check `Standard rates` and view the table of rates – it will be empty.

![disabling-automatic-tax-doesnt-restore-rates](https://user-images.githubusercontent.com/2472348/132679289-2681e503-f43f-4b6a-88ac-25583c3d20ed.gif)

## Discussion

I understand that these rates are most likely cleared when switching from standard to Automated tax calculations because they are treated as an override with the Automated calculation, and as the definition of all rates with the Standard calculation. I can imagine if they weren't cleared, it could cause issues for merchants thinking that they had automated tax, when they are actually still using their old manual rates whenever they apply.

However... this seems like a fairly destructive consequence to allow it to happen without warning. The table that someone has built up could be quite comprehensive and difficult to re-create.

I discovered this when supporting a new user with a very small US store, who would actually be well served by automated taxes as they are unlikely to currently have breached the economic nexus requirements in any other state. However, they thought they needed to charge sales tax in all states, and had put overrides in, then unintentionally had them deleted by changing the Automated taxes setting, possibly thinking they needed to "disable tax" before editing the rates, then enable it again when they were finished. When they found there were no rates saved and no tax charged for customers outside their state, they did not understand why their rates weren't saved.

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior from Settings > General and Settings > Tax > Tax options using the listed sample CSV, then trace the automated-tax setting change and the Standard rates table. Done means existing rates are not silently lost, or the user receives a clear warning before deletion; verify the full reproduction flow again.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.