Last active
October 12, 2022 17:01
-
-
Save lelandf/281c54e7c4e79caf2796e0f148c86923 to your computer and use it in GitHub Desktop.
[RCP] Example of space between currency and price
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 | |
// Both of these examples are specific to Swiss Franc, hence the "chf" in the filter name | |
// Replace with different currency accordingly | |
// This is if currency position is set to "before" | |
add_filter( 'rcp_chf_currency_filter_before', function( $formatted, $currency, $price ) { | |
$formatted = $currency . ' ' . rcp_format_amount( $price ); | |
return $formatted; | |
}, 10, 3 ); | |
// This is if currency position is set to "after" | |
add_filter( 'rcp_chf_currency_filter_after', function( $formatted, $currency, $price ) { | |
$formatted = rcp_format_amount( $price ) . ' ' . $currency; | |
return $formatted; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment