How to hide product description until customer logs in?

theskythatday
Tourist
7 0 1

Hey 😀 I am confused how to proceed with:

 

I want to sell 'samples' for free to only logged in customers. I also want to state the actual price for the full product (materials for interior design - to order this customers contact direct by phone to order custom amount), but I'd like to have the price per metre on the product page - yet only shown when logged in. So:

1. Price per metre shown on product page (only when logged in), but not something you 'add to cart'

2. Free sample can 'add to cart' (only when logged in).

 

So I need to hide the 'add to cart' until log in (can this be done in the code?), as well as a particular 'description' in each product that shows the 'price per metre: $--, contact us to arrange an order'. 

I am confused whether I need to variants one for sample and one for per metre to show full price even though they can't purchase that per metre price only sample 😕 and somehow hide both prices too... Or can I also hide a particular description, maybe in the product page code I can add a specific 'per metre price', that I can fill in on the product pages individually, that can also only show up when someone is logged in?

Thanks so much. I know this is probably advanced, but I am keen to give it a go in the code, if anyone has any advice or tips or a better idea, please let me know your thoughts 🙏

 

Lucy x

Reply 1 (1)
made4Uo
Shopify Partner
3542 663 990

@theskythatday 

 

You need to add a liquid code below and enclose what ever you want to only show when user is logged in. 

 

{% if customer %}

//Your codes here 

{% else %}

<h3> Please log in to see more information</h3>

{% endif %}

We are volunteering to help    |      Likes and Accept as Solution  will be much appreciated.✌
Need a developer?  Do not break the bank. Hire us! For fast reply, shoot us a message using chat at Made4Uo.com

Check how to sell everywhere with Shopify POS. Keep your stuffs private. Refrain from giving unnecessary access to your store.