Skip to content

Instantly share code, notes, and snippets.

View AnanthFlycart's full-sized avatar

Anantharaj B AnanthFlycart

View GitHub Profile
add_filter( 'advanced_woo_discount_rules_category_taxonomies', function($taxonomy){
// Note: For attributes the taxonomy will be start with prefix pa_
// Example: For attribute Color the taxonomy will be pa_color
$taxonomy[] = 'pa_color';
return $taxonomy;
}, 10);
add_filter('advanced_woo_discount_rules_get_product_categories', function ($categories, $product, $variant){
$taxonomies = apply_filters( 'advanced_woo_discount_rules_category_taxonomies', array());
add_action('woocommerce_before_cart', function (){
?>
<script type="text/javascript">
jQuery( document.body ).on( 'updated_cart_totals', function() {
location.reload();
});
</script>
<?php
});