Created
October 26, 2021 12:49
-
-
Save AshlinRejo/78a153a8c75f06a505a35c10ff243dab to your computer and use it in GitHub Desktop.
Discount rules v2: Disable woocommerce_get_price_html event from other plugins
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_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