A swim spa is not a T-shirt. At Spa Solutions, a Swiss retailer of swim spas and cold plunges, the price depends on a choice the customer makes before buying: install it themselves, or book the installation team. I was the sole developer on the custom discount and cart logic that makes that choice work.

Each choice, its own price

On the product page, the installation options are buttons. Each button maps to a dynamic Shopify discount, so choosing an option shows the price for that option straight away, rather than a single list price and a surprise at checkout.

Installation products that cannot go astray

When a customer books the installation, an installation (Montage) product is added alongside the spa. Three rules keep the two together:

  1. Same quantity. Two spas mean two installations, automatically.
  2. Removed together. Remove the spa and its installation goes with it.
  3. Never on its own. The installation product cannot be reached or bought by itself.

Without those rules, a cart can end up with an installation and nothing to install.

A cart that keeps up

The cart drawer and the cart page recalculate prices and discounts live. While a change is being applied, controls show a loading state and are disabled, so a quick double click cannot leave the spa and its installation with different quantities.

One discount at a time

Only one discount is active at a time, and the biggest one is carried into checkout. The customer always gets the best price they qualify for, and the store never stacks discounts it did not intend.

The general pattern

Any product with a service attached, whether installation, assembly or setup, has the same needs: a visible price per option, a service line that follows the product, and a cart that cannot get out of step. Shopify does not do that out of the box, and writing the rules down first is most of the work.

Further reading