Content of the page

$WOOCS->set_currency()

This function allows to set currency by your logic.

Actual from: v.2.1.8/1.1.8  

$WOOCS->back_convert()

Useful function when you want to convert any amount in non-basic currency into basic currency amount. For example you have 40GBP. Basic currency of your shop is EUR, to convert that 40GBP into XX EUR you are need do next:

40 – amount in GBP 0.8343 – rate of 1 GBP relatively to 1… read more

$WOOCS->woocs_exchange_value()

Converts any value which is in the shop default currency into amount of the current selected currency. For example, we get from any place of the site price/amount (70 for example) which keeps in meta field for example as decimal value in the default currency. But we want to recount this value for our purposes according to… read more

$WOOCS->get_checkout_page_id()

This function will help you to define checkout page. Use it to define that current page is checkout.

Better use in your site header.php OR in wp_head hook callback  

$WOOCS->get_welcome_currency()

This function created to define what currency is “welcome” in WOOCS settings.

Welcome currency is currency which will be set for the first visit of any unique visitor to your site if its not redefined by GEO IP rules on the settings page of the plugin.  

$WOOCS->is_use_geo_rules()

Will return TRUE if GEO IP option is enabled on the plugin settings page

$WOOCS->get_geo_rules()

This function returns array of GEO IP rules which are uses in WOOCS

   

$WOOCS->reset_currency()

This function reset current selected currency to default currency

You can use it by your own logic for any customization of behavior on checkout page with this function https://currency-switcher.com/function/woocs-get_checkout_page_id/  

$WOOCS->get_currency_by_country()

Works when GEO IP option is enabled in the plugin settings. This function returns currency which is set in the GEO IP rules of the plugin

Here you can get country codes: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes (use Alpha-2 code) Use next code if you want to get full name of the country by its code:

   

$WOOCS->get_currency_price_num_decimals()

Returns count of decimals for any currency code which is defined on the plugin settings page

$currency – is any currency code, for example ‘EUR’