Add Custom Currency to woocommerce

6 hari yang lalu  |  59x dilihat
Add Custom Currency to woocommerce

/* Custom currency and currency symbol */
add_filter( 'woocommerce_currencies', 'add_my_currency' );

function add_my_currency( $currencies ) {
 $currencies['IRT'] = __( 'Custom Currency', 'woocommerce' );
 return $currencies;
}

add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);

function add_my_currency_symbol( $currency_symbol, $currency ) {
 switch( $currency ) {
 case 'IRT': $currency_symbol = ' تومانءء'; break;
 }
 return $currency_symbol;
}