Soon, we’ll be announcing a fresh new marketplace for TastyIgniter developers.

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[Not Solved] Post code searching error on the first screen

Photo
#1 kittip Offline Junior Member
Need help on the post code searching error, please see attachment for more detail\


   
#2 kittip Offline Junior Member
There is no issue when entering the full address, only error when entering the postcode (Australia Postcode)
#3 sampoyigi Offline 1 == 2
It looks like the issue is from Google Maps API, I just tried searching "3000" on google map and it doesn't give me a location in Australia, but searching "3000 Australia" does.

TastyIgniter uses google to retrieve the coordinates from the postcode/address entered, before checking if the coordinates are within the marked areas. In this case the postcode entered does not only correspond to an address in Australia but another in Denmark (funny). Anyways, a possible solution will be to lock the search to a specific region.

Try this and let me know if it works.
Open system/tastyigniter/libraries/Location.php on line 651
Change
Code:
$url  = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($temp_query) .'&sensor=false'; //encode $postcode string and construct the url query
to
Code:
$url  = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($temp_query) .'&sensor=false&components=country:AU'; //encode $postcode string and construct the url query
#4 kittip Offline Junior Member
Thank you Sampoyigi, now it works. would this change be in the setting somehow?

Hi Sampoyigi, now the search postcode also include other postcode which is not in the delivery zone setup
#5 sampoyigi Offline 1 == 2
Yes an option will be added to set this in the setting.
How do you mean by "search postcode also include other postcode which is not in the delivery zone setup"?
#6 kittip Offline Junior Member
The out of area is still found even not in the delivery zone setting. I only have the issue with postcode 3029 which is not in the zone but the delivery is available, not really sure what the issue.
#7 amit_inn@yahoo.com Offline Newbie
HI Sam,

I must say I am impressed with your skills!

I am in Australia and we restrict delivery by suburbs/post codes instead of defining area from google map so just wondering if there is a way to provide drop-down list of post codes/suburbs instead of users typing their post code

Thanks,
amit

Possibly Related Threads...

Thread / Author
Forum Jump:

Users browsing this thread: 1 Guest(s)