Created
December 3, 2020 08:52
-
-
Save AshlinRejo/938205a4120a4786efe48a4bf8c43103 to your computer and use it in GitHub Desktop.
Discount rules v2: Get applied discount rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('woocommerce_before_cart', function (){ | |
if(class_exists('\Wdr\App\Controllers\ManageDiscount') && class_exists('\Wdr\App\Controllers\DiscountCalculator')) { | |
if (!empty(\Wdr\App\Controllers\ManageDiscount::$calculator)) { | |
$calc = \Wdr\App\Controllers\ManageDiscount::$calculator; | |
$applied_rules = $calc::$applied_rules; | |
//$applied_rules -> here you get applied discount rules | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment