Skip to content

Commit ca29f34

Browse files
authored
Add "Add Image on Products with "new" Tag" snippet
1 parent 4b0b800 commit ca29f34

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This is a list of useful Shopify Snippets that I often reference while developin
99
* [Display Links in a Linklist](#display-links-in-a-linklist)
1010
* [Back or Continue Shopping link on Cart](#back-or-continue-shopping-link-on-cart)
1111
* [Add Class or Id to Form](#add-class-or-id-to-form)
12+
* [Add Icon or Image on Products with "new" Tag](#add-icon-or-image-on-products-with-new-tag)
1213

1314

1415
## Display Products in a Collection
@@ -88,5 +89,12 @@ This is a list of useful Shopify Snippets that I often reference while developin
8889
{% form 'form_name', class: 'custom-class-name', id: 'custom-id-name' %}
8990
```
9091

91-
92+
## Add Icon or Image on Products with "new" Tag
93+
```html
94+
{% for mytag in product.tags %}
95+
{% if mytag == 'new' %}
96+
<a href="{{product.url}}"><img class="new-product" src="{{ 'new-circle.png' | asset_url }}"/ ></a>
97+
{% endif %}
98+
{% endfor %}
99+
```
92100

0 commit comments

Comments
 (0)