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