Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between get_discount_total() and get_total_discount()?

In WooCommerce, I notice in both WC_Cart and WC_Order, there's both get_total_discount() and get_discount_total().

What is the difference between these? Which should I use to get the value of the discount on a cart/order?

like image 765
Jamin Grey Avatar asked Jan 13 '20 06:01

Jamin Grey


1 Answers

Funny. I didn't notice it before.

get_total_discount will return a formatted value of the discount (with the currency symbol, wrapped with HTML).

get_discount_total will return just the value.

like image 183
Shir Gans Avatar answered Nov 15 '22 00:11

Shir Gans