Last active
February 8, 2021 19:48
-
-
Save NickGreen/63d1fb95e7b3f3d47d2decb68169bf08 to your computer and use it in GitHub Desktop.
Switch currency position to left for USD
This file contains 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('woocommerce_price_format', 'woo_custom_format_position', 999, 2); | |
function woo_custom_format_position( $format, $currency_pos ) | |
{ | |
/*'left':$format = '%1$s%2$s'; | |
'right':$format = '%2$s%1$s'; | |
'left_space':$format = '%1$s %2$s'; | |
'right_space':$format = '%2$s %1$s'; | |
*/ | |
IF_CURRENCY_IS_USD { | |
$format = '%1$s%2$s';//Change your position | |
} | |
return $format; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment