Created
October 9, 2018 06:27
-
-
Save rashmimalpande/c65262e23c5f77df726fc03fcd43ccb2 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_separator. $decimal . '</sup>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment