How add new currance to your WPJB

WPJobBoard allows you to use most world currencies, but not all of them. If you need to use some additional currency, that we do not include, you can do this easily using this code snippet.

If you do not know how to use code snippet, please refer to this article with an explanation.

add_filter('wpjb_list_currency', 'my_wpjb_list_currency');
function my_wpjb_list_currency($list) {

$list[] = array(
'code' =>'USD',
'name' =>__('United States Dollars', "wpjobboard"),
'symbol' =>'$',
'decimal' =>2
);

return $list;
}

Each currency has four variables:

  • code – This is the place for currency code [USD, PLN, EUR]
  • name – The name of your currency [United States Dollars, Canadian Dolar, Mexican Peso, Polish Zloty]
  • symbol – A symbol of your currency so this can be $ for dollar, € for Euro or £ for Pounds
  • decimal – This param decides how many numbers after the decimal point will be visible. By default 2.

After you will change all the params, you will receive a new currency. We will add “lew” in our example:

add_filter('wpjb_list_currency', 'my_wpjb_list_currency');
function my_wpjb_list_currency($list) {

$list[] = array(
'code' =>'lew',
'name' =>__('lew', "wpjobboard"),
'symbol' =>'лв',
'decimal' =>2
);

return $list;
}

Now when you go to wp-admin -> Settings (WPJB) -> Pricing -> Add New panel you will see a new currency in the Currency drop-down.

 

Leave a Reply

Your email address will not be published. Required fields are marked *