Unlocking Exclusive Access: How to Hide Shopify Product Prices from Guests

Hey everyone! It's your Shopify expert, diving into a really interesting discussion from the community forum. We recently saw a great question from Paytowin about how to hide product prices from guests, making them visible only to logged-in customers. This is a super common need for specific business models, and the community really chimed in with some fantastic insights and solutions.

Why Would You Want to Hide Prices?

Before we jump into the "how," let's quickly touch on the "why." As Maximus3 hinted, this isn't just a niche request. Many businesses, especially B2B (business-to-business), wholesale operations, or those offering exclusive member-only pricing, need to gate their prices. It helps maintain pricing integrity, encourages account creation, and can be crucial for custom quotes or tiered pricing strategies.

It's worth noting that Tim_1 jumped in to clarify a common misconception: Shopify's B2B features, which allow for things like hidden prices and custom catalogs, are now available on all plans (with some limitations), not just Shopify Plus. This makes implementing such a strategy even more accessible for many merchants!

The Core Principle: Shopify's customer Object

The good news is, Shopify gives us a powerful tool right out of the box: the customer Liquid object. This little gem lets us check if a visitor is logged in or not, forming the basis of all our solutions. If a customer is logged in, the customer object will exist and be true; otherwise, it's false.

DIY Code Solution: Getting Your Hands Dirty with Liquid

If you're comfortable with a bit of code, the community offered some solid manual approaches. Mastroke provided a really comprehensive breakdown, and others like Parampreet and Michross echoed the core Liquid logic. Here's how you can implement it:

1. Product Page (main-product.liquid)

This is where the main product details live. You'll want to modify the section that renders the price.

  • Go to: Online Store → Themes → Edit Code → Sections → main-product.liquid
  • Find:
  • {% render 'price', product: product %}
  • Replace with:
  • {% if customer %}
    
      {% render 'price', product: product %}
    
    {% else %}
    
      
    Please login to see price
    {% endif %}

2. Collection Page (card-product.liquid)

Prices also appear on collection pages, often within a "product card" snippet. You'll need to apply similar logic here.

  • Go to: Snippets → card-product.liquid
  • Find:
  • {% render 'price', product: card_product %}
  • Replace with:
  • {% if customer %}
    
      {% render 'price', product: card_product %}
    
    {% else %}
    
      Login to see price
    
    {% endif %}

3. Don't Forget the Add to Cart Button!

This is a critical step that ShopIntegrations wisely highlighted. Hiding the price but leaving the 'Add to Cart' button open is like locking your front door but leaving a window open! Guests could still add to cart and potentially see the price at checkout, completely defeating your purpose. So, you'll want to wrap your 'Add to Cart' button with the same {% if customer %} logic.

  • In main-product.liquid, locate your Add to Cart button and wrap it like this:
  • {% if customer %}
    
      
    
    {% else %}
    
      Login to purchase
    
    {% endif %}

4. Optional Styling

To make the "Login to see price" message look good, you can add some simple CSS. Mastroke suggested adding this to your theme's CSS file (often theme.css or base.css):

.price-hidden {

  font-size: 14px;

  color: #555;

}

Crucial Considerations for the DIY Approach

Now, while the code snippets are great, ShopIntegrations dropped some really important truth bombs we can't ignore if you go the manual route:

  • CSS Isn't Enough: First, simply hiding prices with CSS (like display: none;) is a no-go for true security. Bots, web scrapers, and even a savvy customer using 'Inspect Element' can easily bypass it. You need to remove the price from the HTML entirely for guests, which the Liquid {% if customer %} condition does.
  • JSON-LD Schema: Second, don't forget your store's JSON-LD schema. This is how search engines understand your product data, and if prices are still embedded in the schema for guests, they might show up in search results, defeating the purpose. You'll need to strip these out for guests too, which can be a bit more complex.
  • Dynamic Elements: Finally, modern Shopify themes often use AJAX for carts, quick-view modals, and other dynamic elements. Manually hiding prices across all these can become a real headache, as ShopIntegrations pointed out. It's easy for a price to 'slip through' if you don't catch every instance.

The App Solution: Simpler & More Robust

Given these complexities, many in the community, including Hidedev and ShopIntegrations, highly recommend using a dedicated Shopify app. Apps like "Magic Hide Price" (mentioned by Hidedev) or "Locksmith" (suggested by ShopIntegrations) are built specifically for this purpose.

These apps often handle all the tricky bits – from the Liquid logic to the JSON-LD schema, AJAX carts, and quick-view pop-ups – ensuring a truly secure and consistent experience without you having to dive deep into your theme's code. It's often the "set it and forget it" solution for busy store owners who want to avoid potential pitfalls and ongoing maintenance.

So, there you have it! Hiding prices from guests on your Shopify store is definitely doable. Whether you prefer the hands-on control of custom Liquid code or the robust, hassle-free approach of a dedicated app, the community has shown us both paths are viable. Just remember the key takeaways: use the customer object, hide the 'Add to Cart' button, and be mindful of CSS limitations and JSON-LD if you're going manual. Choose the method that best fits your comfort level and the complexity of your store, and you'll be well on your way to creating that exclusive shopping experience you're aiming for!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases