Set “Geo Location Setting” if someone doesn’t accept to share his location, show all map markers on the map

You can edit js/mega-superstorefinder.js

search for the following code:

function(error) {
                            if(self.currentState !== self.states.RUNNING) return;
                            self.rest();
                           
                            switch(error.code) {
                                case error.TIMEOUT:
                                    map.status.notify({
                                        message : 'cantLocateUser',
                                        closeable : true
                                    });
                                break;
                               
                                default:
                                    locationNotAvailable();
                                break;
                            }
                        },

And add the following lines

function(error) {
                            if(self.currentState !== self.states.RUNNING) return;
                            self.rest();
                           
                            switch(error.code) {
                                case error.TIMEOUT:
                                    map.status.notify({
                                        message : 'cantLocateUser',
                                        closeable : true
                                    });
                                // Add this code below
                                searchForStores({productsServices : ssf_default_category});
                                break;
                               
                                default:
                                    // Add this code below
                                    searchForStores({productsServices : ssf_default_category});
                                    locationNotAvailable();
                                break;
                            }
                        },

Save and upload and clear browser cache, if a user doesn’t allow to share his/her location, it will show all stores instead.

1+

Users who have LIKED this post:

  • Sofia Moss