$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
global $WOOCS; //$customer_country = 'ES'; $customer_country = $this->storage->get_val('woocs_user_country') $currency = $WOOCS->get_currency_by_country($customer_country);
- 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:
global $woocommerce; $customer_country = 'ES'; print $woocommerce->countries->countries[$customer_country]; //Will print 'Spain'