I hope this helps... For others having the same issue in v2.
First create a new Project in your Google Console, under this project enable the following APIs
- Maps Javascript API
- Geocoding API
- Geolocation API
From the credentials tab, create a new credential then copy your API key and paste into Settings -> Restaurant Tab
Next, you'll make some changes to let the code read your new API key. Some TI version already has these changes so check to be sure.
Open system/tastyigniter/libraries/Location.php
and replace line 755.
$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($temp_query) .'&sensor=false'; //encode $postcode string and construct the url query
With
$url = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($temp_query) .'&sensor=false'.'&key='.$this->CI->config->item('maps_api_key'); //encode $postcode string and construct the url query
Once that's done, let's add a bit of debugging to read the error message from google if any.
In the same file, paste the below code after line 764, you will remove this code later.
var_dump($geocode_data); exit;
Go to your storefront homepage and enter a postcode, before pressing enter, open your browser console.
Right click on the page and click Inspect or Inspect Element.
Once the console dialog opens click 'View Menu' view the Request response under the Network Tab in your browser console. You should see an error message, if you don't, you are good to go.
Don't forget to remove the line added after line 764 after debugging.
With the introduced google quota you might need to increase your daily quota if you are seeing a quota error message.
mediaultra I get it google maps api changed. but this whole script is based around that one thing! maybe build in a function to turn off all of that nonsense. if its not within the area then it gets refunded. atleast this would be a work around until google plays nice again.
There's an option to disable local search from the admin.