To get the total discount amount applied through price rules in cart
To get the total discount amount applied through price rules in cart
if(class_exists('\Wdr\App\Router')) {
$total_discount = 0;
$manage_discount = \Wdr\App\Router::$manage_discount;
if(method_exists($manage_discount, 'getDiscountPerItem')){
if (!empty($manage_discount::$calculated_cart_item_discount)) {
foreach ($manage_discount::$calculated_cart_item_discount as $discount_details) {
if (!empty($discount_details)) {
$total_discount += $manage_discount->getDiscountPerItem($discount_details);
}
}
}
}
//$total_discount Here you gets total discount applied in cart
}