Repository navigation
Conversation
Contributor
|
Thanks for this. It now conflicts with main in CheckoutSidebarIsland.tsx after #132 landed, could you rebase onto main? I'll merge it once CI is green. |
The cart page, checkout summary and order receipt showed a single "Tax"
row, so a rate's own name ("VAT") never reached the customer. They now
show one row per tax line, labelled with the rate ("VAT 16%"). The flat
rate's line is labelled "Tax" rather than the US "Sales tax", so it
reads "Tax 16%". A total with no tax lines still shows as "Tax", and
rows get unique React keys when two rates share a name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moset15
force-pushed
the
feat/tax-rows-named-by-rate
branch
from
December 5, 2026 22:53
8fb4b36 to
39c5820
Compare
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.
What and why
The cart page, the checkout summary and the order receipt show a single "Tax" row, even though the cart and order already carry
taxLineswith each rate's name and percentage. A shop charging VAT can't show "VAT" to its customers.Part of the roadmap in #108.
Behaviour
Changes
astro/tax-rows.ts:taxLineLabelandtaxRows, shared by both islands and the receipt.CartPageIsland.tsx,CheckoutSidebarIsland.tsx: rendertaxRows(cart.taxLines, cart.taxTotal).emails/receipt.ts: the same rows in the HTML and text versions.cart/calculate.ts: the flat rate's line label "Sales tax" → "Tax".No route changes. Orders already placed keep the label stored on their tax lines.
Tests
packages/core/test/tax-rows.test.ts:cart/contactroute with flat tax at 16%: the cart it returns gives one "Tax 16%" row for KES 240.00;recalculatewith flat tax gives "Tax 16%";cart.taxLines.The integration tests fail without the change. Full suite: core 373 (364 before), paystack 105, lite 144, registry-setup 5, all passing.
tsc --noEmitand Biome are clean on the new and changed lines;bun.lockis unchanged.Review points
Merge order with the shipping-options and coupon box PRs: all three edit the checkout summary island on neighbouring lines. Each merges cleanly on its own; whichever goes in first, I'll rebase the others straight away.