How to hide prices unless customers are logged in, Xtra template?

2 0 0

I'm currently working with the Xtra template and am looking to customize it so that prices are hidden throughout the template unless a customer has logged in. Could anyone familiar with this template advise me on where in the JSON structure I can make these modifications effectively?

Replies 3 (3)

Shopify Partner
177 16 26

What files do you find if you search for "price" in the theme code files?


If price elements are clearly specified, you can wrap them in a conditional ({% if customer %}...{% endif %}) to show this content only when customer is logged in. We wrote an article for a similar customization, you can find it here.


Now I'm not sure if this would be the case for your paid theme Xtra

Customer Accounts Concierge
Turn the account page into a beautiful and multifunctional customer portal. Integrate contents, tools, and CRM features from other apps to drive a longer, richer and more personalized customer experience: Profile, Order History, Loyalty, Wishlist, Social Login, Customer Forms.
2 0 0

I only found "price" in a few locations for the theme code files, but this was a orders file. I have some featured products I'd like to remove and have narrowed down the files but cant seem to understand how the Xtra template displays their code. I'll definitely utilize the conditional in the article you provided once I find the exactl location.

1 0 0

Sorry to jump on to this, but im needing to do the same with the Venture Theme.

This was set up previouly by someone else to make customers log in before they could access product pages, however if you search the product it bypasses the log in requirement - same if you google the product and go that way.  Ive had a look to edit the code but cannot get this to work, and now the requirement to log in has gone...


Does anyone have the standard code for the 'product-unit-price.liquid'?  So i can see what it should be and work from there?