Last active
October 9, 2018 06:19
-
-
Save rashmimalpande/31820be116cc14dbceb6fff69e2b389a to your computer and use it in GitHub Desktop.
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
| <?php | |
| add_filter( 'formatted_woocommerce_price', 'ts_woo_decimal_price', 10, 5 ); | |
| function ts_woo_decimal_price( $formatted_price, $price, $decimal_places, $decimal_separator, $thousand_separator ) { | |
| $unit = number_format( intval( $price ), 0, $decimal_separator, $thousand_separator ); | |
| $decimal = sprintf( '%02d', ( $price - intval( $price ) ) * 100 ); | |
| return $unit . '<sup>' . $decimal . '</sup>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment