How can you hide prices on sold items?

Highlighted
New Member
9 0 0

Hi there,

I just sold a couple of pieces on my website, I want to keep these items on my website but would like to hide the prices for customers. I already changed the timber scs liquid as showed underneath.

.is-sold-out .grid-product__price-wrap { display: none; }
But if people click on the product they can still see the price tag, is it possible to hide this too?
Thanks 
0 Likes
Highlighted
New Member
9 0 0

Btw im using brooklyn theme classic

0 Likes
Highlighted
Shopify Expert
1381 111 205

Hello, 

Thanks for post.

1. Go to Online Store->Theme->Edit code
2. Asset->/theme.scss.liquid->paste bellow code in the bottom of the file

.is-sold-out .grid-product__price-wrap { display: none; }

 

0 Likes
Highlighted
New Member
9 0 0

Mmm, doesnt seem to work, doesnt do anything at all.

0 Likes
Highlighted
New Member
9 0 0

The price tag is hidden , but if you click on the product itself the price reveals itself

0 Likes
Highlighted

Could you add a link to your site? If not, could you send it to me directly?

ScreenStaring
Software Development & Consulting
0 Likes
Highlighted
New Member
9 0 0
Highlighted
Highlighted
Shopify Expert
1381 111 205

try this

{% if product.available %}
    <div class="price">
     . . . .
    </div>
{% endif %}

if you face issue 

if you can reach out over Skype or Email for further discussion and taking it ahead accordingly. Email : infoperennialsolution@gmail.com Skype : infoperennialsolution Looking forward to your reply! Thanks! 

0 Likes
Highlighted

Timber should be doing this by default though given this post and from looking at your site, it looks like additional modifications were made that caused this not to occur (the code for unmodified Timber theme can be found here).


While I do hate to further diverge from out the box theme functionality, I can suggest the following. But note that without seeing your actual theme files, the variables I reference e.g., current_variant, product, may not be correct.

 

File: templates/product.liquid

Currently:

<span id="ProductPrice" class="h2" itemprop="price" content="{{ current_variant.price | divided_by: 100.00 }}">
    {{ current_variant.price | money }}
</span>

Change to:

{% if current_variant.available %}
    <span id="ProductPrice" class="h2" itemprop="price" content="{{ current_variant.price | divided_by: 100.00 }}">
        {{ current_variant.price | money }}
    </span>
{% endif %}

If current_variant doesn't work, try product.

 

File: snippets/product-grid-item.liquid

Currently:

 

<span class="grid-product__price-wrap">
    <!--  more code here -->
</span>

Change to:

{% if product.available %}
  <span class="grid-product__price-wrap">
      <!--  more code here -->
  </span>
{% end %}

 

It's also important to note the rules on product.available 

ScreenStaring
Software Development & Consulting
0 Likes