Shopify themes, liquid, logos, and UX
How do I add tags to certain products on product pages, (like few left in stock, or sold out, or new)
Here is a example:
Hi @AMOB,
Please follow the steps below:
- Step 1: Add tags for products, eg 'few left in stock'.
- Step 2: Please go to snippets > card-product.liquid file, at line 90 and add the following code:
If you want to add a 'new' label, you can add the following code:
{% if card_product.tags contains 'few left in stock' %}
<span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">few left in stock</span>
{% endif %}
{% if card_product.tags contains 'new' %}
<span class="badge badge--bottom-left color-{{ settings.sale_badge_color_scheme }}">new</span>
{% endif %}
Hope it helps!
I typed the code in, and added the tag when I edited the product, but did not show up!
did not work! 😞
Hi @AMOB,
Please send your site and if your site is password protected, please send me the password. I will check it.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024