Created
August 11, 2020 07:28
-
-
Save Balakrishnan-flycart/6be6a840094bb861e60e4729bfc910d1 to your computer and use it in GitHub Desktop.
Woo Discount Rules v2 - variable product round up two decimal places
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_filter('advanced_woo_discount_rules_format_sale_price_range', function( $html, $min_price, $max_price){ | |
| $min_price = number_format((float)$min_price, 2); | |
| $max_price = number_format((float)$max_price, 2); | |
| if (function_exists('wc_format_price_range')) { | |
| $html = wc_format_price_range($min_price, $max_price); | |
| } else{ | |
| if(class_exists('\Wdr\App\Helpers\Woocommerce')){ | |
| $html = \Wdr\App\Helpers\Woocommerce::formatPrice($min_price) . ' - ' . \Wdr\App\Helpers\Woocommerce::formatPrice($max_price); | |
| } | |
| } | |
| return $html; | |
| }, 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment