Shopify Pro Tip: How to Hide Product Prices from Guest Shoppers (Code & App Solutions)
Hey there, fellow Shopify store owners! Have you ever found yourself wishing you could gate access to your product pricing? Maybe you run a wholesale business, an exclusive members-only shop, or you just want to encourage sign-ups before revealing the goods. It’s a super common request, and it came up recently in the Shopify Community forums, sparked by a great question from @Paytowin: "How to show prices only to logged-in customers and hide from guests on Shopify?"
It’s a fantastic question because it touches on a key business need for many, and thankfully, the community jumped in with some really solid, actionable advice. Let’s dive into the best ways to tackle this, drawing insights from what our peers shared.
Why Hide Prices from Guest Shoppers?
Before we get into the 'how,' let's quickly touch on the 'why.' For many businesses, particularly B2B, wholesale, or niche markets, showing prices only to logged-in customers can:
- Encourage Account Creation: It's a gentle nudge for visitors to register, helping you build a customer database.
- Protect Wholesale Pricing: Keep your special wholesale rates private from general retail customers or competitors.
- Create Exclusivity: Make your products feel more premium or exclusive, accessible only to a select group.
The Community's Top Solutions: Code, Apps, and Shopify Plus
The discussion in the forums highlighted a few clear paths, ranging from a hands-on code approach to leveraging apps or even native Shopify Plus features. Let's break them down.
1. The DIY Liquid Code Approach (No App Needed!)
This was a popular and well-explained solution, particularly from Balasundar and Charles_Okechukwu. It’s fantastic because it means no monthly app fees and often results in cleaner performance. It does require a little comfort with editing your theme's Liquid code, but it’s quite manageable!
Step 1: Duplicate Your Theme (Seriously, Do This First!)
Before you touch a single line of code, please, please duplicate your theme. As Charles_Okechukwu wisely pointed out, "Takes 10 seconds and saves a lot of pain." Go to Online Store > Themes, find your current theme, click the ⋯ (actions) button, and select Duplicate. Work on the duplicate copy so your live store isn't affected if something goes awry.
Step 2: Find the Right File to Edit
The key here is locating where your theme renders product prices. This file can vary, but common places include price.liquid, product-price.liquid, or even within main-product.liquid. A great tip from Charles_Okechukwu for finding it: in your theme code editor (Online Store > Themes > ⋯ > Edit Code), search for product.price. This will often lead you straight to the relevant snippet.
Step 3: Implement the Price Hiding Code
Once you've found the file (let's assume it's Snippets/price.liquid for many modern themes like Dawn, as Balasundar suggested), you'll wrap the existing price display code with a simple Liquid conditional statement. This checks if a customer is logged in. Remember to use your theme's actual price rendering code where I've put {{ product.price | money }}.
Open Snippets/price.liquid (or your theme's equivalent) and modify it to look something like this:
{% if customer %}
{{ product.price | money }}
{% else %}
{% endif %}
This ensures that only logged-in customers see the actual price, while guests see a friendly "Log in to see price" link.
Step 4: Hide the "Add to Cart" Button for Guests
Balasundar rightly pointed out that if guests can't see prices, they shouldn't be able to add items to their cart either. This prevents confusion and a poor user experience. You can achieve this with a small CSS snippet placed in your theme.liquid file:
Open layout/theme.liquid.
Find the closing tag.
Paste this just before it:
{% unless customer %}
{% endunless %}
This clever bit of code uses Liquid to only inject the CSS rule when a customer is *not* logged in, effectively hiding all "Add to Cart" buttons across your store for guests.
2. Shopify Plus Native Features
If you're on Shopify Plus, Charles_Okechukwu mentioned that there are native B2B tools available that handle this kind of functionality, often allowing for more granular control over pricing and customer groups. If this is your setup, it's definitely worth exploring with Shopify Support, as a built-in solution is often the most robust and integrated option.
3. Leverage Shopify Apps
For those who prefer a no-code solution or need more advanced features, apps are a fantastic route. Moeed and Charles_Okechukwu both brought up the App Store as a viable option. While they typically come with a monthly fee (usually $5-$20/month), they offer convenience and often more granular control without touching any code.
Some popular apps mentioned in the thread include:
- B2B/Wholesale Lock Manager by Wholesale Helper
- Locksmith by Lightward
- B2B Login/Lock & Hide Price by BSS Commerce
These apps are designed specifically for this purpose and can often handle other related tasks like hiding entire products or pages based on customer tags. Just be mindful that, as Moeed noted, some apps "can slow things down depending on how they inject the logic," so always test performance after installation.
So there you have it! Whether you're a DIY code enthusiast, a Shopify Plus enterprise, or prefer the convenience of an app, there's a solid solution to control who sees your product prices. Remember to always back up your theme before making code changes, and test thoroughly on your duplicate theme before publishing. Happy selling!