Get the value for discount in cart

82 views Asked by At

If we have a coupon code that say gives a 5% discount....how can I grab the discounted value into a variable? For example $100 subtotal with a 5% discount. The value of the discount would be 5. I need to get the "5" into a variable.

1

There are 1 answers

0
callmedpit On

Based on this answer Magento Checkout : Get Subtotal Value without iterating

I was able to add another variable for discount:

$discount = $totals["discount"]->getValue();