Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AshlinRejo/78a153a8c75f06a505a35c10ff243dab to your computer and use it in GitHub Desktop.
Save AshlinRejo/78a153a8c75f06a505a35c10ff243dab to your computer and use it in GitHub Desktop.
Discount rules v2: Disable woocommerce_get_price_html event from other plugins
add_action('advanced_woo_discount_rules_after_initialize', function (){
if(class_exists('\Wdr\App\Router')){
remove_all_filters('woocommerce_get_price_html');
add_filter('woocommerce_get_price_html', array(\Wdr\App\Router::$manage_discount, 'getPriceHtml'), 100, 2);
add_filter('woocommerce_get_price_html', array(\Wdr\App\Router::$manage_discount, 'getPriceHtmlSalePriceAdjustment'), 9, 2);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment