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.

So, you decided that you only want members to be able to add products to their cart - that's a bold move! Not a problem, we're here to help. 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 add to cart button only to members, then save the plan.

Edit Your Theme

Now, we need to find where in the code your add to cart buttons 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 contains the button to submit the product to the cart. Search (Ctrl or Cmd-F) for "submit" and look for the <button> which mentions adding to cart

  • This button will be surrounded by an opening <div> and closing </div>. To disable this button, we'll add a bit of code before and after the div tags.

Before, add this code:

{% assign sm_show_cart = true %}
{% include 'simplee-memberships' with 'cart' %}
{% if sm_show_cart %}

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

{% endif %}

Save your theme, then visit a product page to see if the Add to Cart button appears when you are not logged in as a member.

If that worked, login as a member, and see if the button appears. We hope that worked! 🤞

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

Did this answer your question?