Jump to content

Issue with some Stores not Displaying with Postal Code Search in Store Contacts


Austra02

Recommended Posts

Hi All,

 

I've got a strange issue with my 'Store Contacts' not showing some stores when a Postal Code search is done - even if the exact same postal code as a store is used for the search. I'm using: 1.6.1.11

 

Others stores display okay, but some don't. All the settings for the stores not displaying are correct; there are no strange characters in the setting for the store, but it just won't display.

 

I've set the Store Contacts to one store that works and one that doesn't to show this issue: https://glindawand.com.au/stores

 

If a postal code search is performed for 2009, it shows no stores, even though I have a store registered with a postal code of 2009. If you change the search to 2015, it works. If a search for 4006 (the postal code of the other store), it shows up correctly.

 

I've done all the usuals as well: cleared the cache; turned on recompiled, etc., but nothing is working.

 

I hope someone can help with this, as my retailers are getting annoyed when their store doesn't display.

 

Thanks in advance,

Scott.

Edited by Austra02 (see edit history)
Link to comment
Share on other sites

Hi!

I've checked your store and find the reason. Problem connected with google maps response, if you check request in developer console with postal code 2009 then you will see areas in next order:
1) 2009, Chang Wat Kalasin, Thailand
location:
{lat: 16.7367457, lng: 103.296235}
2) 2009 Pitt St, Sydney NSW 2000, Australia
location:
{lat: -33.8701143, lng: 151.2094018}
3) ...
Next PrestaShop makes request for 'stores' controller and takes location from google maps respone: latitude:16.7367457
longitude:103.29623500000002
 
It's because in stores.js first location is used:
searchLocationsNear(results[0].geometry.location);
You can add loop in stores.js and check country in location response from google. 
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

 

Hi!

I've checked your store and find the reason. Problem connected with google maps response, if you check request in developer console with postal code 2009 then you will see areas in next order:
1) 2009, Chang Wat Kalasin, Thailand
location:
{lat: 16.7367457, lng: 103.296235}
2) 2009 Pitt St, Sydney NSW 2000, Australia
location:
{lat: -33.8701143, lng: 151.2094018}
3) ...
Next PrestaShop makes request for 'stores' controller and takes location from google maps respone: latitude:16.7367457
longitude:103.29623500000002
 
It's because in stores.js first location is used:
searchLocationsNear(results[0].geometry.location);
You can add loop in stores.js and check country in location response from google. 

 

WOW! Thanks so much!!

The only thing is I must admit I have no idea how to add a 'loop' into the stores.js. Are you able to help with this?

Thanks again; I really appreciate this!

Cheers,

Scott.

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...