Re: Changing "Sold out" to "Coming Soon" for CERTAIN Products

Changing "Sold out" to "Coming Soon" for CERTAIN Products

SHFWS
Tourist
15 0 1

Hi!

 

We are trying to change the "sold out" banner on CERTAIN products to "coming soon." We can not do this without editing the code, as we have tried apps, but they do not keep our inventory accurate. 

 

I was reading a lot of discussions and trying to figure out what code to implement into our theme, but can not seem to find a solution for a Prestige/REBUY Smartrr theme. So, if anyone has any suggestions on what to input into my 'product-item.liquid' snippet to allow me to tag certain items to "coming soon" we would definitely appreciate the help!

 

Thanks!

Replies 3 (3)

noiseymur
Shopify Partner
20 2 8

Hello. May I see an example product page to better understand your problem ?

I'm assuming that the code checks availability of the item and if it's not available it outputs the sold out banner. If that's the case, you can change the part where "Sold Out" text is rendered with and if-else tag that checks for coming-soon tag in products tags. If that tag exists, it should render "Coming soon", if it doesn't exist, it should render "Sold out".

Here is an example:

Change this:

{% unless product.available %}
   <div class="banner">
      Sold out
   </div>
{% endunless %}


To this:

{% unless product.available %}
   <div class="banner">
     {% if product.tags includes 'coming-soon' %}Coming soon{% else %}Sold out{% endif %}
   </div>
{% endunless %}
SHFWS
Tourist
15 0 1

I am not seeing anything remotely similar to this in my snippets. I have tried changing out the "On Sale" code to say "coming soon" as well, but that didn't work either

noiseymur
Shopify Partner
20 2 8

This was just an example. Your code might not be 100% similar to this. I can send your store a collaborator request and check that for you. If it's ok, DM me the store URL