Last active
July 8, 2021 05:43
-
-
Save Balakrishnan-flycart/f363bbd8d696b6be43d146ecee7f2c2b to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - Check customized condition
This file contains hidden or 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_filter('advanced_woo_discount_rules_check_condition', '__return_true'); | |
add_filter('advanced_woo_discount_rules_is_conditions_passed', function($result, $rule_object, $rule){ | |
$conditions = $rule_object->getConditions(); | |
$rule_id = $rule_object->getId(); | |
if(in_array($rule_id, array(1, 2))){ | |
//Your custom logics enter here and return true or false | |
//true -> Run rule | |
//false -> Do not run rule | |
return true; | |
} | |
return $result; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment