Skip to content
Clinton Jay Ramonida

Overview / Luxury tax

A tax that had to be right in eleven places at once

Canada’s luxury tax, built through every surface a price appears on, behind a flag so it could go dealer by dealer.

Period Dec 2024 – Jan 2025Role Full-stack engineer

The problem

Canada’s Select Luxury Items Tax applies above a price threshold, and a dealer site has to show it consistently everywhere a price or a payment appears. That is four search-result card versions, the vehicle detail page, the quick view, the inventory carousel, the calculator’s cash, finance and lease tabs, and GM Digital Retailing. Any one of them disagreeing with another is a customer who stops believing the number and a dealer carrying compliance risk. An older “disable luxury tax” toggle made the existing behaviour harder to reason about than the tax itself.

What I built

Central configuration for the tax rules with a WP-CLI manager, so settings could be changed across the network rather than site by site. Tax-aware pricing through every card version, the detail pages, the carousel and the calculator. French throughout. Unit tests over 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 rather than the whole fleet at once. It shipped in the 11.8 release, and four edge cases surfaced in the week after: price breakdowns that did not sum to the final price, a lease display on one card version, a finance payment that disagreed between card and calculator, and the tax missing from the calculator’s total cash price. All four went out as patch releases that same week.

What that week taught me

Shipping behind a flag is not the same as shipping carefully. The flag limited who saw the bugs; it did not stop me writing them. What found them was production traffic hitting combinations the tests did not have — which is an argument for shipping to a small group early, not for testing less.

Stack

  • PHP
  • WordPress
  • Vue.js
  • Optimizely
  • WP-CLI
  • PHPUnit
  • Jest