Skip to content

Instantly share code, notes, and snippets.

@stuartduff
Last active June 11, 2021 13:23
Show Gist options
  • Select an option

  • Save stuartduff/e2caa1d60b3f31504523215571d1ad17 to your computer and use it in GitHub Desktop.

Select an option

Save stuartduff/e2caa1d60b3f31504523215571d1ad17 to your computer and use it in GitHub Desktop.
Change the pakistani rupe symbol in WooCommerce only on checkout page
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
if ( ! is_checkout() ) {
return $currency_symbol;
}
switch( $currency ) {
case 'PKR': $currency_symbol = 'PKR'; break;
}
return $currency_symbol;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment