JustinWDev of Archived Theme Support
11/3/2015 - 12:41 PM

Show percentage saved with a discount code instead of amount saved

Show percentage saved with a discount code instead of amount saved

You have

"You saved $5 with discount: 50SHIRTSFREE"

You want

"You saved 25% with discount: 50SHIRTSFREE"

{% if discounts %}
  {% assign discount = discounts_amount | times: 1.00 %}
  {% assign price = subtotal_price | times: 1.00 %}
  <p>You saved {{ discount | divided_by: price | times: 100.00 | round: 0 }}% with discount: {{ discounts.first.code }}</p> 
{% endif %}