How do I hide prices of products in my Shopify shop so that guests cannot see them?

I am currently running a store on Shopify and want to implement a policy where product prices are only visible to logged-in customers. However, visitors who are not logged in (guests) can still see the prices. I would like to hide all product prices from these guests. How can I do it?

This is doable with a bit of Liquid and CSS! Here’s the cleanest way to handle it natively without an app:

In your theme go to Online Store → Themes → Edit Code and find your product-card.liquid or price.liquid snippet (depends on your theme) and wrap the price display in a login check like this:

liquid

{% if customer %}
  {{ product.price | money }}
{% else %}
  <a href="/account/login">Login to see price</a>
{% endif %}

You’ll need to apply this same logic to:

  • Product cards on collection pages

  • Product detail pages

  • Search results

Also add this CSS to hide any price that slips through:

css

.price {
  display: none;
}

body.customer-logged-in .price {
  display: block;
}

This is a workaround, but if navigating through codes feel technical, i could come in and save you a ton of work, let me know the outcome after trying.

The Liquid snippet above is a good start, but just a heads up - you also need to hide the ‘Add to Cart’ button. Otherwise, guests can still add the item to their cart and see the price at checkout.

Also, definitely don’t rely on that CSS trick. Bots (like Google) and anyone who knows how to right-click ‘Inspect’ will still see the prices. You also need to strip the price out of your theme’s JSON-LD schema so it doesn’t show up in search results.

Honestly, I tried doing this manually on a store last year and it became a nightmare with AJAX carts and quick-view modals. If you’re not on Shopify Plus (which has this built-in for B2B), I highly recommend just using an app like Locksmith. It locks down the prices and cart securely without having to hunt down every single price variable.

Correction – B2B is now available on all plans (with some limitations) since April – Shopify brings native B2B features to millions more merchants.

You can do this with a small theme tweak. Just wrap the price in a condition so it only shows for logged-in users. For example:

{% if customer %}
  {{ product.price | money }}
{% else %}
  <a href="/account/login">Login to view price</a>
{% endif %}

Add this wherever the price appears (product page, collections, etc.). This way, guests won’t see prices and will be prompted to log in instead.

Hmmm.

What’s the point?

That’s actually what a lot of companies do on certain products they have a special sale, add to cart to see price.