How to add 'Sold' on Collection page DEBUT theme

Solved
bexpaints
Explorer
52 0 10

Hello!

I have been searching through so many posts and cannot seem to solve this!

I am looking to add 'Sold' on products that I have priced as '£0' only on the collection page. (added a star on the screenshot below where I want it positioned)

https://bex-paints.myshopify.com/

password: obreur

please can someone help!!

thank you

Screenshot 2021-07-15 at 12.07.31.png

0 Likes
dfiroz
Excursionist
19 3 6

You can apply the below code.

 

{% if product.price == 0 and template == 'collection' %}
   {{ 'products.product.sold_out' | t }}
{% endif %}
If helpful, then please Like and Accept Solution.
Want to modify or custom changes on store, hire me.
- Feel free to contact me on imfirozhossain@gmail.com regarding any help
bexpaints
Explorer
52 0 10

hello @dfiroz 

amazing, so i'm nearly there! how can I move the 'Sold' to underneath the product title? I would also like this bold.

Thank you!!

 

Screenshot 2021-07-15 at 12.29.35.png

0 Likes
dfiroz
Excursionist
19 3 6

This is an accepted solution.

You can apply the below code.

 

{% if product.price == 0 and template == 'collection' %}
  <div class="price-sold"> {{ 'products.product.sold_out' | t }}</div>
{% endif %}

 

It's nothing but adding a block level element.

 

If this help you, like the post and marked as solved.

Thank you.

If helpful, then please Like and Accept Solution.
Want to modify or custom changes on store, hire me.
- Feel free to contact me on imfirozhossain@gmail.com regarding any help
bexpaints
Explorer
52 0 10

It worked! thank you so much!

0 Likes
dfiroz
Excursionist
19 3 6

You are most welcome.

If helpful, then please Like and Accept Solution.
Want to modify or custom changes on store, hire me.
- Feel free to contact me on imfirozhossain@gmail.com regarding any help