Hiding Product Prices

If you have created a membership rule to only show prices to members, this will walk you through updating your theme

Carly avatar
Written by Carly
Updated over a week ago
We don't want you to edit your theme code if you don't want to! We encourage you to ask for setup assistance by clicking on the chat button and asking us to update your theme.

Let's walk through updating your theme to hide prices from non-members. This update is not done automatically to your theme since themes can do this in so many ways.

Create the Rule

If you haven't done this already, open Simplee Memberships, go to Plans, then create or edit the plan you want this to apply to.

In the Rules section, click to add a new rule, select Show product prices only to members, then save the plan.

Edit Your Theme

Now, we need to find where in the code your prices are located. We'll focus on the one that almost every store has - the product page.

In your Shopify admin, click on Online Store, find the theme you want to edit, then click Actions > Edit Code

Next, follow these steps:

  • In the Templates folder, click on product.liquid

  • This template will often point to a section or other file which loads the body of the product page. In many cases it will be product-template - when you hover over this name, you can click the arrow to open the file

  • In product-template.liquid, we want to find the section which displays the price. Search (Ctrl or Cmd-F) for price and look for code which appears to display price information. In this case, there is a <div> which includes 'product-price' - which seems like a good place to try

  • This section is wrapped by a <div> tag, which will will wrap by adding some custom code before and after.

Before the opening <div>, add this code:

{% assign sm_show_price = true %}
{% include 'simplee-memberships' with 'prices' %}
{% if sm_show_price %}

After the closing </div>, add this code:

{% endif %}

Save your theme, then visit a product page to see if the price appears when you are not logged in as a member. (sometimes it takes a minute for the theme to be updated)

If that worked, login as a member, and see if the price appears. We hope that worked! ๐Ÿคž

We recommend going through all of your site's pages to see if prices appear anywhere else. Perhaps on the collection pages, on the search results, and maybe somewhere on your home page.

For help with this, please chat with our team now - we want to help!

Did this answer your question?