I need to make an automatic selection of the shipping zone, depending on the city of the user.
To determine the city, I use the plugin "GeoIp Detection". I show the city of the user in the header of the page using the shortcode: [geoip_detect2 property="city"].
Or is it better not to use this plugin, but look in the direction of this code? Get user geolocated country name in Woocommerce 3
I created two zones for courier shipping:
Zone 1 - a separate city in which the store is located. Shipping cost $25.
Zone 2 - the rest of the country where the courier can deliver the products. Shipping cost $50.
If the user lives in the city where the store is located, then Zone1 is displayed. If the user lives in another city, then Zone2 is displayed.
Unfortunately, I can not find the code that would help in solving this issue ((
I really need help. Thank you in advance!