Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change Kuwaiti Currency in WooCommerce
<?php
/**
* Plugin Name: Change Kuwaiti Currency in WooCommerce
* Plugin URI: https://github.com/yttechiepress/kuwaiti-currency
* Author: TechiePress
* Author URI: https://github.com/yttechiepress/kuwaiti-currency
* Description: Change Currencies in WooCommerce
* Version: 0.1.0
* License: GPL2
* License URL: http://www.gnu.org/licenses/gpl-2.0.txt
* text-domain: ocotw
*/
/**
* Change an existing currency to KWD
*
* Go to https://github.com/woocommerce/woocommerce/blob/master/includes/wc-core-functions.php
* In the get_woocommerce_currencies() to find your currency code.
*/
add_filter( 'woocommerce_currency_symbol', 'techiepress_change_woocommerce_currency_symbol', 99999, 2 );
function techiepress_change_woocommerce_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
// Insert currency code from the get_woocommerce_currencies().
case 'KWD' : $currency_symbol = 'KWD';
break;
}
return $currency_symbol;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment