Website: https://rowsomeleather.com/
I sell leather items that are almost exclusively one-off items.
I need the following thing to happen:
Products tagged as “coming soon” have a badge of COMING SOON.
Products tagged as “portfolio” have a badge of PORTFOLIO.
All products with a zero inventory are otherwise tagged as SOLD OUT.
The only way I have found to achieve this, would require I manually tag all sold out items accordingly, which isn’t practical for me. If anyone knows of some code that would work, I would be eternally grateful!
Hey @RowsomeLeather ,
This need to take a look in your theme file.
Would you like to share the store collab code in the p/m.
Thanks
Hello @RowsomeLeather ,
Go to Snippets → product-card-badges.liquid
Here at line no. 26 you will find the code of the existing badge ‘sold out’ you can extend it to apply ‘coming soon’ and ‘portfolio’ badge a/to you need.
Let me know if you need me to apply this for you. You can drop me an email for services.
Regards
Guleria
@RowsomeLeather that’s an advanced theme customization.
To DIY there are existing discussions for older themes you can search for to try and apply similar process.
Meanwhile if you just need this customization take care of then contact me for services.
Contact info in forum signature below
.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
I tried a number of tutorials for themes such as Dawn and Prestige, and didn’t have success.
I understand that, and can do it to some degree, but not quite.
- Log in to your Shopify Admin Panel
- Go to: Online Store > Themes
- Find your current theme (e.g., Horizon theme).
- Click “Actions (…)” and select “Edit Code”
- In the left-hand sidebar go to snippets > product-card-badges.liquid.
- Add the provided code according provided screenshot given below.
{%- assign tags = product.tags | join: ',' | downcase -%}
{%- if tags contains 'coming soon' -%}
COMING SOON
{%- elsif product.available == false -%}
{{ 'content.product_badge_sold_out' | t }}
{%- elsif product.compare_at_price > product.price -%}
{{ 'content.product_badge_sale' | t }}
{%- endif -%}
- Please add the tag to your products
- Expected output
If this helped, don’t forget to Like it and Mark it as a Solution!