Site asks chrome users for location, need to turn it off

Heppells
Excursionist
13 0 3

HI,

My site asks chrome users for their location and I would like to turn it off.

Can anyone suggest how to do this?

Thanks

0 Likes
Wahab_Ahmad
Shopify Partner
717 112 176

Hello @Heppells, It is because of some javascript code. can you share store link 

0 Likes
Heppells
Excursionist
13 0 3

Hi @Wahab_Ahmad and thanks for replying.

URL is www.heppells.co.uk

0 Likes
Scorick
New Member
2 0 0

Hi, I have the exact same problem. Could you solve it? If yes, I would need some help with that, too.

Kind regards

0 Likes
CarbonBlueGTS
New Member
3 0 0

Hello, was this ever solved? Our site does the same thing.

0 Likes
Scorick
New Member
2 0 0

I went to fiverr and got somebody to fix it for me. You can get somebody for 5$ there

0 Likes
MikeSoy
New Member
1 0 0

Do you have a contact of the person that fixed it for you?

0 Likes
Shop2000
Excursionist
26 0 3

Do a search for 

navigator.geolocation

 

in your themes JS files and comment out whatever is calling the function. That should do it.

 

It will look something like: 

 

 

 

var getGeoLocation = function getGeoLocation() {
  return new Promise(function (resolve, reject) {
    var options = {
      maximumAge: 3600000,
      // 1 hour
      timeout: 5000
    };

    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function (_ref) {
        var coords = _ref.coords;
        return resolve(coords);
      }, reject, options);
    } else {
      reject();
    }
  });
};

 

 

 

Cheers

0 Likes