• Hi, thanks in advance for any help.

    I’m using the Current Location extension on my website; I placed the shortcode on a page and when I visit this page the browser asks me permission to share my location, correctly.
    The problem is that once I give it the permission it redirects me to a new page with URL ‘www.<myurl>.com/?gmw_cl_address’ and I noticed that ‘gmw_cl_address’ corresponds to the value in the ‘name’ attribute of the input tab of the Current Location shortcode.

    Is it normal? How can I change the URL to where it redirects me? Is it possible to avoid the redirection or at least to come back where it was?

    Thanks again for any help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello @fabriziocacicia,

    I apologize for not replying sooner.

    The current location should not redirect you to a different page. It should only reload the same page to be able to use the new current location data.

    Anyway, you should be able to disable the page refresh using the script below ( added to the functions.php file of your theme ):

    
    function gmw_disable_auto_locator_refresh( $localize, $options ) {
    
    	$localize['pageLocatorRefresh'] = false;
    
    	return $localize;
    }
    add_filter( 'gmw_localize_options', 'gmw_disable_auto_locator_refresh', 10, 2 );
    

    Let me know if this helps.

    Thread Starter fabriziocacicia

    (@fabriziocacicia)

    Hi @ninjew, thanks for the reply.
    I already knew how to disable the page refresh. In fact, it was already my temporary solution to the problem.
    Regarding the redirection, it goes on the same URL the problem is that I placed the shortcode inside a search result page and after the redirection, it removes the search arguments that were present before.

    For example, I am on the page ‘www.mywebsite.com/s=searchkey’ and after I give the location permission I end up on ‘www.mywebsite.com/?gmw_cl_address=’.

    Plugin Author Eyal Fitoussi

    (@ninjew)

    @fabriziocacicia,

    I see now. That makes sense. The plugin should keep any existing URL arguments on the submission of the Current Location form.

    I am going to look into this and see if I can apply a quick workaround to correct this behavior.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect URL after giving location permission’ is closed to new replies.