Add Currency
-
Hello guys, now I guide you how to add a new currency:
– Firstly, be sure that your site is using WP Hotel Booking the latest version.
– Install child theme for your site.
– In functions.php file of the child theme, add the following code:
add_filter( 'hb_payment_currencies', 'add_new_currency' ); function add_new_currency( $currencies ) { $currencies['currency_key'] = 'enter_currency_name'; return $currencies; } add_filter('hb_currency_symbol', 'add_new_currency_symbol', 10, 2); function add_new_currency_symbol($symbol, $currency){ if($currency == 'currency_key'){ $symbol = 'enter_currency_symbol'; } return $symbol; }
For example: I’ll add US currency. The code I use is:
add_filter( 'hb_payment_currencies', 'add_new_currency' ); function add_new_currency( $currencies ) { $currencies['US'] = 'US Dollar'; return $currencies; } add_filter('hb_currency_symbol', 'add_new_currency_symbol', 10, 2); function add_new_currency_symbol($symbol, $currency){ if($currency == 'US'){ $symbol = '$'; } return $symbol; }
Done!!! Now your new currency is ready in WP Hotel Booking >> Settings >> Currency.
If you have difficulties in adding the currency, please open your own topic. Don’t reply in this one.
Regards
- The topic ‘Add Currency’ is closed to new replies.