Hide Price When Customer Is Not Logged In

Easily hide product prices from guest visitors on your Shopify store. Require customers to log in to view prices and encourage account creation. Improve B2B privacy and control pricing visibility.

Hide Price When Customer Is Not Logged In
0 sections

To hide the price in Shopify when the customer is not logged in, you can use Liquid to check if a customer is logged in. Here's how:

- Step 1: Open the Theme Editor

  • Go to Shopify Admin → Online Store → Themes
  • Find the your theme (e.g the Debut theme) and click Actions → Edit Code
  • - Step 2: Find the Price Code

    You’ll want to edit the files where product prices are displayed:

  • For product page: sections/product-template.liquid
  • For product listings (e.g., collection pages): snippets/product-card-grid.liquid or snippets/product-price.liquid
  • In these files, search for the code that looks like this:

    {{ product.price | money }}

    Or:

    {{ current_variant.price | money }}

    - Step 3: Wrap the Price in a Customer Check

    Replace the price code with the following:

    {% if customer %}
      {{ product.price | money }}
    {% else %}
      <span class="login-to-see-price">Login to view price</span>
    {% endif %}

    - Step 4: (Optional) Style the Message with CSS

    To make the message more visible or styled nicely, go to: Assets → theme.scss.liquid and add:

    .login-to-see-price {
      color: #cc0000;
      font-weight: bold;
      display: inline-block;
      margin-top: 5px;
    }

    - Step 5: Test the Result

  • Open your store in incognito mode (logged out) — price should be hidden.
  • Log in as a customer — the price should appear.
  • Want to make the message clickable? Try this:

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

    Related Articles

    Boost Sales Today: The Simple Power of Free Shipping Thresholds for Shopify Stores
    Tips & Tricks

    Boost Sales Today: The Simple Power of Free Shipping Thresholds for Shopify Stores

    Discover how implementing a strategic free shipping threshold can dramatically increase your Shopify store's conversion rates and average order value. Learn quick, actionable steps for both merchants and developers to set up and optimize this powerful tactic within a single day.

    May 16, 20266 min
    Boost Conversions: How to Add a Countdown Timer to Your Shopify Store
    Tips & Tricks

    Boost Conversions: How to Add a Countdown Timer to Your Shopify Store

    Learn how to add an urgency-driving countdown timer to your Shopify product pages and sales promotions. This tutorial covers methods from theme editor blocks to custom Liquid code and when to choose a dedicated app, helping you drive conversions.

    May 14, 20268 min
    Convert a Shopify Section to a Block (Horizon Theme version)
    Tips & Tricks

    Convert a Shopify Section to a Block (Horizon Theme version)

    In Horizon, Shopify allows developers to convert standalone sections into reusable blocks, giving merchants even more control in the theme editor. Let’s walk through the process step by step.

    May 10, 20267 min
    How to Add Tailwind CSS to Shopify
    Tips & Tricks

    How to Add Tailwind CSS to Shopify

    Learn how to add Tailwind CSS to Shopify for faster, responsive design. Enhance your store’s look with clean, utility-first styling. Perfect for theme customization

    May 10, 202615 min