G
G
Genri_Rus2020-01-04 23:23:17
WordPress
Genri_Rus, 2020-01-04 23:23:17

How to display the total price and total discount on the cart page?

I just can’t understand how you can get a total discount for all products on the shopping cart page in this place?
5e10f3fdca2a7276613543.png
So it displays 2 values, but how to display the total discount?

$items = WC()->cart->get_cart();

foreach($items as $item => $values) {
  $price_sale = $values['data']->get_sale_price();
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2020-01-04
@Genri_Rus

Damn, well, Google is full, for example, a tutorial about all sorts of options
https://jeroensormani.com/showing-sale-prices-cart...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question