Hide products price from product details page until user logins in Shopify

Hello Friends,

This helping tool is for Shopify developers.

Have you ever imagined how much difficult or easy is to implement a functionality on your Shopify store in which a visitor will not be able to see product details, price or add to cart feature until he login to his store account or sign ups and then login?

Well, it’s very easy. It’s going to hardly take your 10 minutes to do this update.

Please follow the below steps to “Hide products price from product details page until user logins in Shopify”

Steps:

1. Click on “Settings” >> “Checkout”
2. Visit the “Customer Accounts” section and Select “Accounts are required” option checked.
3. Now, save you configurations.
4. Click on “Themes” >> go to “edit HTML/CSS” page
5. Now, locate the liquid template where you want to hide the products price, products description, add to cart option, etc. for any product. Lets say “product.liquid”

Now, visit the html section which display products price or other options you want to hide for visitors.

Now it’s time to add the magic code:

{% if customer %} 
   Code for products pricing goes here
{% endif %}

{% if customer %} 
   Code for products description goes here
{% endif %}

{% if customer %} 
   Code for Add to cart here
{% endif %}

You can add separate checks or can have all code under one check. It totally depends on your requirement.

6. Save the template and You are done!

Hope this article has helped you in your job.

Thanks!

Related Post