Skip to content

v0.2.0 — WC tax-class custom mapping

Choose a tag to compare

@ejosterberg ejosterberg released this 05 May 04:55
· 27 commits to main since this release

What's new

WooCommerce tax-class → OST category custom mapping. v0.1.x hard-coded every WC tax class to OST's general category, which over-collected in states with category-specific exemptions (e.g., a Minnesota shop selling clothing should charge $0 sales tax, not the full 9.025%). Merchants can now map any custom WC class to one of the six OST categories, or mark a class as non-taxable.

Built-in defaults (no setup required)

WC tax-class slug OST category
'' / standard general
reduced-rate general
zero-rate (skip — non-taxable)

New WP-CLI commands

wp opensalestax tax-class-list
wp opensalestax tax-class-set <wc-class> <ost-category>
wp opensalestax tax-class-reset

Valid OST categories: general, clothing, groceries, prescription_drugs, prepared_food, digital_goods. Use '' to mark a class as non-taxable.

Verified end-to-end

On Proxmox VM 907 against engine v0.36, ZIP 55401 with a $100 line:

  • general → $9.025 tax (full MN stack: state + county + city + 3 transit districts)
  • clothing → $0 tax with engine citation: "Clothing is non-taxable in Minnesota (Minn. Stat. 297A.67 subd 8)."

Quality gate

  • 57/57 unit tests pass (16 new in TaxClassMapTest)
  • PHPStan level=max clean
  • PHP-CS-Fixer (PSR-12 + risky) clean
  • Security review re-run for v0.2: deserialization safety verified; allow-list validation in set(); admin-UI exposure deferred to v0.3 with capability-gate requirement noted

Upgrade

Drop-in replacement for v0.1.2 — behavior is unchanged for sites that don't define custom tax classes.

cd wp-content/plugins/opensalestax-woocommerce
git pull
composer install --no-dev

Or update via Composer (composer update ejosterberg/opensalestax-woocommerce).

Full changelog

See CHANGELOG.md.