Check if the rule id is applied or not

Verify if a specific rule ID is applied or not.

if (class_exists('\Wdr\App\Router')) {
    $applied_rule_ids = [];
    $manage_discount = \Wdr\App\Router::$manage_discount;
    $applied_rules = $manage_discount::$calculator::$applied_rules;
    if (!empty($applied_rules)) {
        foreach ($applied_rules as $rule) {
            $applied_rule_ids[] = (int) $rule->rule->id;
        }
    }
    
    if (in_array(1, $applied_rule_ids)) { // here, you can check if the rule id is applied or not
        // do your stuff
    }
}