Hide the "[CTA / block]" on the product page when the product is ["product-handle-1"] or ["product-handle-2"].
Want more control? See the expanded prompt ›
On the product page, hide the 'enterprise contact' CTA block when the product handle is 'starter-kit' or 'sample-pack'.
- Wraps the existing section in
{% raw %}{% unless %}{% endraw %}based on handle, tag, or template. - Inverts cleanly — same prompt structure works to show only on specific products.
- Customer-tag aware for B2B / wholesale visibility gating.
- Theme-editor preview keeps working — Fudge writes Liquid the editor renders.
What you're trying to do
Not every section should show on every product. You probably have content — enterprise CTAs, ingredient lists, sizing charts, B2B blocks — that only makes sense for a subset of your catalog. The clean fix is a small Liquid conditional, not a duplicate template.
Things to watch out for
- Product handle vs product ID — handles are stable across renames in most cases; Fudge uses handle by default.
- Tag-based vs handle-based — tags scale better as your catalog grows; ask Fudge to use tags instead.
- Multiple conditions — Fudge composes multi-condition logic cleanly (e.g. 'hide if handle is X or tag includes Y').
- Inverting — Fudge handles this: same prompt structure works to show a block only on specific products.
How Fudge does it
Fudge duplicates your live theme into a draft, makes the targeted edit (Liquid logic, JS event, conditional rendering) your prompt requires, and tests it on the draft preview. Everything starts in draft — review the diff, verify the behavior, and publish when you're ready. Your live store stays untouched.
When conditional visibility logic is the right answer
Some product pages need elements that other product pages don’t — enterprise CTAs on flagship products, gift-wrap toggles only on giftable SKUs, sustainability callouts only on certified products. Conditional Liquid logic shows or hides blocks based on product handles, tags, or types.
When this is worth doing
Use conditional logic when the difference is structural, not just stylistic. Hiding a “compare prices” block on a starter kit makes sense; hiding “free shipping” on some products doesn’t.
The pattern is highly reusable — same prompt structure works for “show only on X” and “hide on Y” cases.
What makes a great implementation
- Product-handle-based or tag-based — flexible matching.
- Inverting works the same way — “show only on X” and “hide on Y” follow the same logic.
- Doesn’t break the template — fails gracefully if a product handle is renamed or removed.
Common mistakes to avoid
The biggest mistake is hard-coding too many conditions. If 30 different blocks have conditional logic, the template becomes unreadable. Use customer-tag visibility gating for broader segmentation.
The second mistake is missing the inverse. If you hide a block on starter-kit, also make sure the rest of the buy box doesn’t have other failures on that product.
Pair this with customer tag visibility gating and theme code investigation — three technical tools for fine-grained control.