Shopify Theme Customization: Expert Tips to Hide Prices for Specific Products (Like Bundles!)
Hey there, fellow store owners! You know, one of the best parts about the Shopify community is how we all chip in to solve those little head-scratchers that pop up when you're trying to make your store just right. I was recently diving into a thread on the Shopify forums that tackled a super common, yet surprisingly tricky, problem: how to hide the price for a specific product, especially when it's a bundle that costs $0.00 until customers build it out.
Our friend, scaredcowboy, kicked off the discussion with a classic scenario. They had a fantastic "mix and match" bundle product, powered by the Foxr Bundle app, that was set to $0.00. The challenge? On their homepage's featured products collection, this $0.00 price was showing up, which, let's be honest, doesn't exactly scream "buy me!" when it's meant to be built by the customer. They were using the Savor theme and had tried some conditional logic in their price.liquid file, but instead of hiding just the bundle's price, it was making all prices disappear. Sound familiar?
The Core Problem: Understanding Your Theme's Variables
This is where the community really shines. Moeed, another sharp mind in the forums, quickly pinpointed the issue. scaredcowboy's initial attempt looked something like this:
{% if product.price > 0 %}
{% render 'price',
show_unit_price: true,
product_resource: product_resource,
show_sale_price_first: block_settings.show_sale_price_first
%}
{% else %}
{% endif %}
The problem, as Moeed explained, wasn't the logic itself, but the variable being checked. In the Savor theme's specific price block (likely located in blocks/price.liquid), the product information isn't passed as a generic product object. Instead, it's referenced as product_resource. So, when product.price > 0 was checked, it was always evaluating to false because product simply didn't exist in that context, leading to all prices being hidden.
The Go-To Solution: Targeting $0.00 Products
The most straightforward and widely applicable solution, which scaredcowboy confirmed worked for them, involves checking the correct variable. Here's how you can implement it, assuming you're facing a similar situation with a $0.00 product and a modern Shopify theme like Savor:
Step-by-Step Instructions:
- Access Your Theme Code: From your Shopify admin, go to Online Store > Themes. Find your current theme, click Actions > Edit code.
- Locate the Relevant File: Moeed's advice, and the common practice for themes like Savor, points to
blocks/price.liquid. This is often where the core logic for rendering product prices lives, especially in sections or blocks. (Quick note: always make a duplicate of your theme before making code changes!) - Identify the Price Output: Inside
blocks/price.liquid, you'll likely see a line (or a block of lines) that renders the price. It might look something like this original snippet from scaredcowboy's post:{% render 'price', show_unit_price: true, product_resource: product_resource, show_sale_price_first: block_settings.show_sale_price_first %} - Apply the Conditional Logic: Wrap that price rendering code with an
ifstatement that checksproduct_resource.price.
Here's the corrected code snippet that Moeed provided and scaredcowboy found success with:
{% if product_resource.price > 0 %}
...existing price code...
{% endif %}
You'll replace ...existing price code... with the actual {% render 'price', ... %} block that you found in your file. This conditional ensures that the price only displays if it's greater than zero. If it's $0.00, it simply won't render anything, leaving a nice blank space, which is often exactly what you want for a bundle product.
Moeed also gave a heads-up that this change will typically hide the $0.00 price on the bundle's individual product page too, which is usually ideal since your bundling app (like Foxr) will handle the dynamic pricing display there anyway.
An Alternative: Hiding a Price for a Specific Product by Handle
While hiding all $0.00 prices is a great general solution, what if you have a product that's not $0.00 but you still want to hide its price for some unique reason? Or maybe you have other $0.00 products where you do want the price shown? Frankybiz jumped in with another excellent approach: targeting a product by its handle.
This method uses an unless statement, which is essentially the opposite of an if statement (it renders content unless the condition is true). You'd use it like this:
{% unless product_resource.handle == 'your-bundle-handle' %}
{% render 'price',
show_unit_price: true,
product_resource: product_resource,
show_sale_price_first: block_settings.show_sale_price_first
%}
{% endunless %}
To use this, you'd replace 'your-bundle-handle' with the actual handle of the specific product you want to hide the price for. You can find a product's handle by going to its product page in your Shopify admin and looking at the URL slug, or by scrolling down to the "Search engine listing preview" section and checking the URL there. This gives you precise control over which product's price gets hidden, regardless of its actual price value.
Wrapping It Up
Both of these solutions are fantastic examples of how a small tweak in your Liquid code can make a big difference in your store's presentation. Whether you're dealing with bundle products, custom quotes, or just unique inventory, knowing how to conditionally display (or hide!) prices is a powerful tool in your Shopify arsenal. The key takeaway here, as Moeed highlighted, is always understanding the specific variables your theme uses in different contexts. A quick check of your theme's Liquid files, or a shout-out to the community, can save you a ton of guesswork!