• Resolved pierrehooker

    (@pierrehooker)


    Hello, I have geolocation installed, the woocommerce status page shows it is installed. However what isnt working is when going to the cart page instead of the shoppers current location being guesstimated by the golocation and showing the shipping rates it simply says: “Enter your address to view shipping options.”

    So I var dumped the geodata

    <?php // Get an instance of the WC_Geolocation object class
    				$geo_instance  = new WC_Geolocation();
    				// Get geolocated user geo data.
    				$user_geodata = $geo_instance->geolocate_ip();
    
    				// Get current user GeoIP Country
    				$country = $user_geodata['country'];
    
    				// Get current user GeoIP State
    				$state   = $user_geodata['state'];
    
    				echo 'state: '.$state.'<br />country:'.$country;
    				echo '<hr />';
    				var_dump($user_geodata);
    
    				?>

    which spit out

    array(2) {
      ["country"]=>
      string(2) "US"
      ["state"]=>
      string(0) ""
    }

    So it seems that the state isnt being properly set! Any ideas what is going on here? It was my understanding the entire point of the geolocation is to show default shipping rates on the cart page. Also, I have already attempted changing to the 2019 theme and disabling all extraneous plugins with zero effect.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Problems with Geolocation and Shipping estimation on the cart page’ is closed to new replies.