• Resolved Archie Makuwa

    (@archie22is)


    I have set up WooCommerce to issue pricing and custom shipping based on location. Everything is working fine.

    However, the client requested that if a South African is overseas and they want to purchase, they should have the ability to overwrite the location by manually selecting South Africa and therefore inheriting the right pricing and shipping methods.

    Can anyone point me in the right direction? I appreciate your input.

Viewing 1 replies (of 1 total)
  • Michael K

    (@mikkamp)

    Automattic Happiness Engineer

    Hi Archie,

    There is the filter ‘woocommerce_geolocate_ip’ available for returning a country based on IP. This is run before the actual Geolocation is run, so it’s not actually overriding the returned country. But you could still use it to return the country for South Africa based on some specific requirements.

    I’d suggest to have a look at how the filter is used here: https://github.com/woocommerce/woocommerce/blob/3.3.1/includes/class-wc-geolocation.php#L149

    You can also look around at the code in that class in case you need to reuse any of it.

Viewing 1 replies (of 1 total)
  • The topic ‘Is it possible to overwrite the geolocation?’ is closed to new replies.