Support » Plugin: WP Store Locator » opening sorted locator page from another page

  • Resolved ksolans

    (@ksolans)


    I need to have a store locator field in the sidebar of each page of my site. I need to submit that field and open the locator page using the address or zip that was entered and only show those stores.

    Is there a way to open the locator page already sorted? I figure I would have a widget with a text field and a submit button. Does this make sense?

    https://wordpress.org/plugins/wp-store-locator/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    There is no easy way to do this right now, but if you know how to code that you can create it yourself. There will be a widget for this in the premium version, but that isn’t ready for release yet.

    You would have to do the following: add a search form in the sidebar and send it to the store locator page. In the url you will see the searched parameter ( like &location=amsterdam or so ). You take that and use it in the js file and include it in the first request the store locator makes. ( there is better code in an old thread about this somewhere in the support form, but I can’t find it back ).

    Thread Starter ksolans

    (@ksolans)

    I’ve been able to pass the address/zip value into my store locator page. I haven’t been able to figure out where to include the value into the js. Is it in the wpsl-gmap.js file or is it somewhere else?

    Also, this is a great plugin. I’ve been able to adapt it to just about everything I need it to do. Nice work.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Search for ‘function codeAddress()’, there you will see the address var which normally takes the data from the input field. Change that so that it takes the value from the url if the url param exists.

    But this codeAddress function is normally only called when a user clicks on the ‘search’ button, so you will have to write some extra code that will call the codeAddress when the url param exists as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘opening sorted locator page from another page’ is closed to new replies.