spree-taxes
Spree Taxes
Tax in Spree 6 is three separate decisions:
- What is sold →
Spree::TaxCategoryon the product/variant (copied to line items). - Where it goes → the purchase's tax address (ship address by default) and its market.
- Who computes it → the market's tax provider, falling back to
Spree.default_tax_provider(defaultSpree::TaxProvider::Internal, which readsSpree::TaxRaterows).
Whatever computes it, the output is always the same: Spree::TaxLine rows on the cart/order, folded into included_tax_total / additional_tax_total by Spree::Carts::RecalculateTotals (see spree-order-totals).
Coming from 5.x zones and
Spree::Calculator::DefaultTax? Tax zones and tax adjustments are gone — seespree-upgrade-5-to-6.
Tax categories
Spree::TaxCategory — store-scoped; name, is_default (one default per store; items with no category use it), tax_code (the code an external engine knows it by, e.g. an Avalara tax code). Products/variants reference one; line items snapshot tax_category_id. Delivery methods can carry a category for shipping tax; fees without one use the store default.
Tax rates (Internal provider)
Spree::TaxRate (tax_…, store-scoped, soft-deleted) has no zone — it names its jurisdiction by ISO code: