Content of the page

Switch currency with language change

WPML: open functions.php of your current wp theme drop there next PHP code:

See WPML docs about languages codes Polylang: open functions.php of your current wp theme drop there next PHP code:

https://wordpress.org/support/topic/switch-currency-with-language-change-polylang/ See Polylang docs about languages codes GTranslate: open functions.php of your current wp theme drop there next PHP code:

… read more

How to force any currency on the checkout page

Sometimes its necessary force on checkout page any currency by logic of business. open functions.php of the current wp theme and drop there next script:

Change ‘USD’ to any currency you need … Notice: works only when “Is multiple allowed” option is enabled (Yes).  

How to to display the text “Call for Price” when the price is 0 or blank

Next code will do the job:

   

How to get GEO IP data about the user on the site

Use the next WooCommerce code:

You can then do: print_r($pd) and see all info which are provided by WooCommerce GEO IP functionality Or you can simply get country code by: (GEO IP should be enabled in WOOCS)

For example:

Use Alpha-2 code for countries: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes Read also: https://currency-switcher.com/function/woocs-get_currency_by_country/  

How to round prices to 500

open index.php of the plugin find public function raw_woocommerce_price($price) on the same end of this function replace:

to:

  Also you can try to use this hook: https://currency-switcher.com/hook/woocs_raw_woocommerce_price/  

How to set right options in the Braintree account

This article describes how to make right options for https://www.braintreepayments.com/ when you want let your shop accept customer selected currency added in the WOOCS plugin options page. In Setting > Processing > Merchant Account. You need one merchant account per currency. In the Braintree Sandbox mode, you can create as many merchant accounts as you want…. read more

How to round price to 50 cents

Open index.php of the plugin, find public function raw_woocommerce_price($price) and instead

write:

http://stackoverflow.com/questions/11692770/rounding-to-nearest-50-cents Also you can try to use this hook: https://currency-switcher.com/hook/woocs_raw_woocommerce_price/  

How to hide payment gateway on checkout

Sometimes it is necessary hide payment gate on the checkout page in multiple mode dependently of the current currency. From version 2.1.4/1.1.4 additional css class implemented in tag <body>. Example: currency-usd,  where usd there is the current currency. So it is very easy from now to hide any gates on checkout by your logic just using… read more

How to manipulate with currencies rates

Sometimes some customers need manipulation with currency rates, for example add to USD rate 10%. Every body has its own logic and Math. This article just show how to do this. open your theme functions.php on the same bottom of the file write next code:

fix: for versions lower 2.1.5 in index.php of the WOOCS… read more