Luxury tax
Canada’s luxury tax, built into every place a price appears, behind a flag so we could roll it out dealer by dealer.
- Period
- Dec 2024 – Jan 2025
- Role
- Full-stack engineer
- Reading
- 1 min
The problem
Canada’s Select Luxury Items Tax applies above a price threshold, and a dealer site has to show it the same way everywhere a price or payment appears. On Tadvantage that meant four versions of the search-result card, the vehicle detail page, the quick view, the inventory carousel, the calculator’s cash, finance and lease tabs, and GM Digital Retailing. If any two disagree, the shopper stops believing the number and the dealer carries the compliance risk. On top of that, an older “disable luxury tax” toggle made the existing behaviour harder to reason about than the tax itself.
What I built
I built central configuration for the tax rules with a WP-CLI manager, so settings could change across the whole network in one go instead of site by site. Pricing became tax-aware on every card version, the detail pages, the carousel and the calculator, with French throughout. Unit tests cover the configuration, the utilities and the card rendering.
Rolling it out
I replaced the old toggle with an Optimizely-targeted flag, so it could go live for specific dealers instead of the whole fleet at once. It shipped in release 11.8, and four edge cases turned up the week after: price breakdowns that didn’t add up to the final price, a lease display on one card version, a finance payment that differed between the card and the calculator, and the tax missing from the calculator’s total cash price. All four fixes went out as patch releases that same week.
What that week taught me
A flag limits who sees the bugs. It didn’t stop me writing them. Production traffic found them, hitting combinations my tests didn’t cover, and that’s why I still like shipping to a small group early. It isn’t a reason to test less.
Stack
- PHP
- WordPress
- Vue.js
- Optimizely
- WP-CLI
- PHPUnit
- Jest
