I wish to present/cover a payment within the WooCommerce checkout course of relying on the placement of the person.
For this i wish to first use the IP deal with of the person to find out the placement and later the deal with he enters.
I got here throughout the build-in Geolocation potential of WooCommerce with the next lessons:
- WC_Geo_IP (https://docs.woocommerce.com/wc-apidocs/class-WC_Geo_IP.html)
- WC_Geo_IP_Record (https://docs.woocommerce.com/wc-apidocs/class-WC_Geo_IP_Record.html)
- WC_Geolocation (https://docs.woocommerce.com/wc-apidocs/class-WC_Geolocation.html)
I can get the customers IP deal with with:
$geolocation = new WC_Geolocation();
$ipaddress = $geolocation->get_ip_address();
However i do not appear to have the ability to get the customers nation code. How would i am going about this?