Fizz Hide Price

Fizz Hide Price / Guides

How do I hide prices until customers log in on Shopify?

Last updated · Ode Labs

Wrap the price and the buy button in a Liquid check for a logged-in customer ({% if customer %}), or use an app that does the same without code. Either way, that only hides the price on screen: to stop guests buying, you also need a check in the cart and checkout, and to keep the price out of the page entirely you need Shopify B2B catalogs or a password-protected store. Pick by which of those three things you actually need.

What do you need hidden: the number, the purchase, or the price itself?

Most stores need the first two; only some need the third.

  • "Guests shouldn't see prices on the page." A display change is enough.
  • "Guests shouldn't be able to buy." You need a check in the cart and checkout, because a product can be added to a cart without visiting its page. Shopify documents cart permalinks built from "one or more variant IDs", and the Ajax POST /cart/add.js endpoint adds variants to a cart directly (Cart API).
  • "Nobody outside my customers should be able to find our prices." You need B2B catalogs or a private store. See how to keep wholesale prices private on Shopify.

How do I hide prices with theme code?

Wrap every price and buy button in {% if customer %}; it's free, and it changes the display only.

This is the standard answer on the Shopify Community. In the thread on hiding wholesale prices, the suggestion is to add the check "where you add the conditional checking for if there is a logged in customer":

{% if customer %}
  ...price and add to cart button...
{% else %}
  <a href="/account/login">Log in to see prices</a>
{% endif %}

It works because Shopify's customer Liquid object is available "when a customer is logged in to their account" and is empty otherwise.

How do I show prices only to approved customers?

Check a tag as well: {% if customer and customer.tags contains 'wholesale' %}.

Tag a customer in Customers once you've approved them. Untagged accounts then see the same message as guests.

Where do I have to make the edit?

Everywhere your theme prints a price, which is more places than you'd think.

The product page, collection grids, search results, quick view, the cart drawer, product recommendations and any "featured product" sections. In Online Store 2.0 themes these are spread across several sections and snippets. Duplicate your theme before editing, and test in a private window.

What doesn't theme code do?

It doesn't stop a purchase, remove the price from the page, or survive a theme change.

  • Purchases: anyone with a variant ID can still use a cart link or /cart/add.js and check out.
  • The price in the page: a product's JSON at /products/<handle>.js includes its price (Ajax Product API), and so does the structured data search engines read. One wholesale merchant found their prices in search results; the reply in that thread explains: "Search engines will be pulling the price from the schema.org structured data in the code of the product pages."
  • Theme changes: a new theme, or an update you accept, means redoing the edits.

Can Shopify B2B hide prices from guests?

It hides wholesale prices from guests; it doesn't hide your regular prices.

If your trade customers are set up as B2B companies, their prices live in B2B catalogs, which "choose which products and prices to offer your B2B customers". In a blended store (retail and trade together), Shopify's blended and dedicated stores guide says: "Only logged-in B2B customers can view B2B prices, products, and account information." B2B is available on the Basic, Grow, Advanced and Plus plans, not on Starter or Retail (B2B plan features).

A logged-out visitor still browses the store as a regular shopper and sees whatever price the product has. If you want guests to see no price at all, combine B2B with theme code or an app, or make the store private.

Can an app hide prices and block the purchase?

Yes, if it uses a cart and checkout validation Function as well as hiding the price.

Shopify lets apps add a cart and checkout validation Function. The docs are direct about its effect: "Validation errors that your function returns always block checkout." A store can run up to 25 of them. When comparing price-hiding apps, ask:

  1. Does it block the purchase, or only hide the button? Test it: copy a cart link for a hidden product and open it as a guest.
  2. Is it uninstall-safe? Apps that run from a theme app embed leave nothing behind. Apps that paste code into your theme files can leave it there.
  3. How is it priced? Many price by Shopify plan, and some free plans cover only one lock.

How does Fizz Hide Price do it?

It hides prices with a theme app embed and blocks the purchase with a validation Function.

Fizz Hide Price works this way:

  • Rules: hide prices on all products, or by product tag, collection or specific product, optionally only for shoppers in some countries.
  • Who sees prices: any logged-in customer, or customers with tags such as wholesale. Buyers ordering for a Shopify B2B company can always see prices if you tick that option.
  • Instead of the price: a "Log in to see prices" link, a "Request a quote" form, or nothing.
  • At checkout: the Function checks every cart line. A shopper the rule doesn't allow sees your message, by default "{product} is only available to logged-in customers. Log in to buy it.", and can't check out, including through a cart link or /cart/add.js.
  • Uninstall: switch off the app embed or uninstall, and the theme is as it was.

Like theme code, its on-screen hide is display-only: the price is still in the page source and in /products/<handle>.js, and it doesn't change your structured data. What it adds is the checkout block. It's free to install while it launches.

Should I just make the store private?

Only if you sell to trade alone; it hides everything from everyone without the password.

Shopify's Restrict access to your online store guide: in Online Store > Preferences, under Store access, turn on Private mode, set a password, and optionally tick Restrict access to B2B customers only. In private mode "all of your online store's pages are hidden from visitors and search engines". That's right for a dedicated wholesale store and wrong for a store that also sells retail.

Which method should I use?

Method Hides price on screen Blocks the purchase Price out of the page
Liquid {% if customer %}YesNoNo
B2B catalogsWholesale prices onlyNo: guests buy at the regular priceWholesale prices only
App with a checkout FunctionYesYesNo
Private (password) storeWhole storeYesYes

How do I check it works?

Test as a guest, by link, and as an approved customer.

  1. Open the store in a private window: check a product page, a collection, search and the cart drawer.
  2. Paste a cart link for a hidden product (/cart/<variant-id>:1) and try to check out.
  3. Log in as an approved customer and repeat; prices and checkout should work.
  4. Log in as an unapproved customer and repeat.