Repository navigation
Create the US tax region when the onboarding address has no state - #367
Merged
Merged
Conversation
A per-state country (US, Canada) got no tax region when the store address had no state, or a state the presets do not know. The wizard address is optional, so the merchant saw no zone at all in Settings > Tax. The region is now always built. With scope "home" (US) it lists no state until the merchant adds one; a state with no preset, such as Oregon, has no sales tax, so an empty region is correct. With scope "all" (Canada) it lists every province, without the home-state extra rate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Every checkout used the fixed ports 20100-20102, so two worktrees could not run at once. bin/dev-up now picks free host ports once, saves them with WP_URL in .env, and runs docker compose up -d. bin/dev-urls prints the addresses. orca.yaml runs bin/dev-up when Orca creates a worktree and docker compose down -v when it archives one. The Vite dev server origin and the PHPUnit database host read the saved ports from .env. The README and docs no longer hard-code the ports. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Vite port (5173) was fixed in vite.config.js and in EnqueueAdminScripts, so only one worktree could run `npm run dev`. - bin/dev-up saves VITE_PORT in .env: 5173 plus the offset of the nginx port from 20100. The nginx port is unique per stack, and the dev server is not running when bin/dev-up runs, so a free-port probe would not work. - vite.config.js reads VITE_PORT with strictPort, because the plugin loads its scripts from that exact port. - docker-compose.yml passes VITE_PORT to the php container, and docker/wp-config.php defines KECOM_VITE_DEV_SERVER from it. EnqueueAdminScripts reads that constant and falls back to 5173. - bin/dev-urls prints the Vite address. README, .env.example and the per-worktree-docker-ports OpenSpec change are updated. Lint and typecheck pass. Two dev servers at the same time are not tested. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scope: home(US): the region lists no state until the merchant adds one. A state with no preset (for example Oregon) has no sales tax, so an empty region is correct.scope: all(Canada): the region lists every province, without the home-state extra rate.bin/dev-uppicks free host ports once, saves them withWP_URLin.env, and runsdocker compose up -d.bin/dev-urlsprints the addresses.orca.yamlrunsbin/dev-upfor a new worktree anddocker compose down -vwhen it is archived. The Vite origin and the PHPUnit DB host read the saved ports. Docs no longer hard-code the ports. Spec:openspec/changes/per-worktree-docker-ports/.Behavior to know
A US store with no state has an enabled US zone with no states.
DefaultTaxStrategy::get_rate()returns 0 for an address that matches no state, so US orders have no tax until the merchant adds a state. The US has no federal sales tax, and the presets have no rate to guess. A hint in the Tax settings UI is possible later but is not part of this PR.Test plan
composer test:docker:integration -- --filter=StorePresetsTestcomposer test:docker:integration -- --filter=LocalPresetSourceTestbin/dev-upin a second worktree starts a stack on different portsI did not run the test suites for this PR. I did check the dev stack: a fresh volume installs WordPress, and the plugin migrates and seeds.
🤖 Generated with Claude Code