How to hide prices on Dawn Theme until user login?

Hi,

I have a website that I am developing for the wholesale market and I would like to hide the prices of my products across the whole site unless the user is logged in. I was able to do this when I had a Debut theme but I can’t work it out in the new Shopify 2.0 Dawn Theme (5.0)

I realise that there are apps for this but I do not want an app for something I hope might be quite simple to impliment.

Many Thanks

Mat

2 Likes

Hi,

There is a solution for this here
Try this and let me know if it does not work for you.

Cheers!

1 Like

@Sewing-Geek

yes, please code

@Sewing-Geek

I found a solution.

Went to theme > Edit Code > Sections > product-template.liquid

Once on the template hit CTRL F to access the find option and look for: product_price

Added the following code in Red Bold to hide price

{% if customer %}

{% include 'product-price', variant: current_variant %}
{% else %} Our Price: (Dealers Only) {% endif %}

You can change Our Price: (Dealers Only) to what ever you’d like to substitute the price with.

To hide the add to cart button I did the following:

On the same template hit CTRL F to access the find option and look for: addtocart

Added the following code in Red Bold to hide price

{% if customer %}

{% unless current_variant.available %} {{ 'products.product.sold_out' | t }} {% else %} {{ 'products.product.add_to_cart' | t }} {% endunless %} {% if section.settings.enable_payment_button %} {{ form | payment_button }} {% endif %} {% endif %}
{% endform %}

Thanks!

But this solution isn’t for the Dawn theme?

1 Like

@SeanConnors

sorry for that can you please send store url

Actually never-mind, I am dealing with a cart issue now, I have solved the price issue.

Hi dear this was very helpful, thank you.
Please how would i go about if i also wanted to hide the price from all my collection pages and my home page?

And also in the search please