Trying to show regular price and what the price will be after a coupon code worth 15% is entered.

New Member
4 0 0

Sorry if a repeat. Could someone show me the Liquid code to do the math and display on the product details page the regular price for an item and what the price will be after a coupon code worth 15% is entered? We aren't using the Compare At price.

 

I'm fairly familiar with editing our theme code and manipulating Liquid in our template, but this one has me stumped.

 

For instance, I want to have something like this:

Regular Price: $100

Price After Coupon: $85

 

Thanks for any help provided.

0 Likes
Shopify Expert
2505 420 529

Hi @Greg_Hallmark 

Follow this:

{% assign per_price = price | times:15 | divided_by:100 %}
{% assign sale_p = price | minus: per_price  %}
<span> {{ sale_p | money}} </span>

Note: here price is your product price variable so change as per your code

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes