[% if (o.items[i].compare_at_price > o.items[i].price) { %] [%#Shopify.formatMoney(o.items[i].compare_at_price, theme.moneyFormat)%] [%#Shopify.formatMoney(o.items[i].price, theme.moneyFormat)%] [% var diff = o.items[i].compare_at_price - o.items[i].price; var percentageDiff = Math.round(((o.items[i].compare_at_price - o.items[i].price) / o.items[i].compare_at_price) * 100); %]
You Save [%#percentageDiff%]% ([%#Shopify.formatMoney(diff, theme.moneyFormat)%])
[% } else { %] [%#Shopify.formatMoney(o.items[i].price, theme.moneyFormat)%] [% } %]