Content of the page

realmag777

All posts by realmag777

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    

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 …  

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: http://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: http://currency-switcher.com/hook/woocs_raw_woocommerce_price/  

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: http://currency-switcher.com/hook/woocs_raw_woocommerce_price/