Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AnanthFlycart/2e72653a9705ddeaff28f26f6149e062 to your computer and use it in GitHub Desktop.

Select an option

Save AnanthFlycart/2e72653a9705ddeaff28f26f6149e062 to your computer and use it in GitHub Desktop.
// Merge all the Discount Bars
add_filter('advanced_woo_discount_rules_advance_table_based_on_rule', function($advanced_layout, $rule, $discount_calculator, $product, $product_price, $html_content) {
if (is_array($advanced_layout) && isset($advanced_layout[0]['badge_bg_color']) && !empty(isset($advanced_layout[0]['badge_bg_color'])) && method_exists($rule, 'getId')) {
$advanced_layout[0]['rule_id'] = $rule->getId();
}
return $advanced_layout;
}, 10, 6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment