Skip to content

Commit ece8b3f

Browse files
authored
add "original price of discounted products" snippet
1 parent dbcacae commit ece8b3f

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
@@ -14,7 +14,7 @@ This is a list of useful Shopify Snippets that I often reference while developin
1414
* [Add On Sale Badge on Products Based on Price](#add-on-sale-badge-on-products-based-on-price)
1515
* [Insert Block inside a for loop at any position](#insert-block-inside-a-for-loop-at-any-position)
1616
* [Open External links in New Tab](#open-external-links-in-new-tab)
17-
17+
* [Add Original Price of Discounted products on Cart Page](#add-original-price-of-discounted-products-on-cart-page)
1818

1919
## Display Products in a Collection
2020
```html
@@ -147,3 +147,11 @@ $(document).ready( function() {
147147
jQuery('a[href^="http"]').not('a[href^="'+$(location).attr('hostname')+'"]').attr('target', '_blank');
148148
});
149149
```
150+
151+
## Add Original Price of Discounted products on Cart Page
152+
Inset the following code inside items loop in cart template.
153+
```html
154+
{% if item.product.compare_at_price > item.price %}
155+
<s>{{ item.product.compare_at_price | money }}</s>
156+
{% endif %}
157+
```

0 commit comments

Comments
 (0)