Changing 'Sold Out' Badge To 'Coming Soon', BUT Only For Specific Product.Types

Hi, I am making a new upgrade to my store, and just bought Stiletto Theme

I’m wondering if someone can help with some liquid coding, that edits “Sold Out” badges to say “Coming Soon”, but ONLY for items with a custom product.type labeled “Coming Soon”, or in a “Coming Soon” collection. Whichever route may be easiest.

So if an item has the product.type “Coming Soon” and has 0 inventory, it will display “Coming Soon” on the badge. If the product doesn’t have the “Coming Soon” product.type and 0 inventory, it will display the “Sold Out” badge as normal.

Thank you very much! I really hope someone can help!

My site URL: https://of39cl3vf2hpozp8-57068945600.shopifypreview.com/collections/coming-soon

(Preview only available in two days)

.

.

.

.

.

.

.

.

@GemPages_Agents

@KetanKumar

@hammadCodes

@PaulNewton

@Ninthony

@dmwwebartisan

@ExpertRookie

@MandasaTech

@GemPages

@Mike-Omega

@PageFly-Richard

@ZestardTech

Hi, this should do:

{% if product.inventory < 1  and product.type contains 'Coming Soon' %}

 Coming Soon 

{% elsif product.inventory < 1 %}

 Sold out 

{% endif %}
1 Like

Hi @kgbfashionista thanks for your reply. Where to put the code?

Hi,

Find the file called product-grid-item.liquid

There, find this part of the code:

And replace whatever you have there to the one I`ve sent before

@kgbfashionista I dont have any file called “product-grid-item.liquid”..

My theme is Stiletto

Right, I don`t know what files Stilleto theme has, but you will need to find the file that represents product grid