Guides · Aus der Werkstatt · 2 min

One template instead of ever more conditions in code

Maria Ducos · updated October 2026
In short

A specific group of trade customers was to see new products, but on exactly those products a discount notice that stays everywhere else had to disappear. The obvious fix would have been to add yet another condition to the code. Instead, we created a separate product template. It’s cleaner, and the client has maintained it themselves ever since.

The case

A B2B merchant has customer groups with different terms. One group sees a notice about its discount on every product page. Then a new product line was added: displays for retailers. The discount didn’t apply to those, so the notice couldn’t appear there. On all other products it was to stay.

Why “just delete it” would have been wrong

Removing the notice from the code would have removed it from all products. Another condition in the code (“if product is from line X, don’t show it”) would have worked, but every new exception would have needed a developer again. After a few years, a template like that is a knot of special cases nobody understands anymore.

Questions about your store?
Audit in 3 business days. For €490.
To the audit

The fix: a separate product template

Shopify allows multiple templates for product pages. We created a “Displays” template that looks exactly like the normal one, just without the discount notice. All existing display products were assigned this template.

The real win: when a new display is added, the merchant’s team simply selects the “Displays” template in the admin. No developer, no code, no ticket.

Important: the template only controls what is displayed. Who can see which products and buy them at what price is still handled by the B2B catalogs.

Your takeaways

  • Not every special behavior needs more code. Often it just needs the right template.
  • Your team can maintain good solutions themselves. With every customization, ask: who does this next time?
  • Display and permissions are two layers. What someone sees and what someone is allowed to do belong in different places.
  • Custom templates exist for products, collections and pages. Special products, one-offs or campaign pages often don’t need a rebuild, just their own template.

Is your theme getting more complicated with every exception? We clean it up and build it so your team can maintain it themselves.

Rather talk than read?

20 minutes, honest and no strings attached. Afterwards you know what your store needs.