Viewing 10 replies - 16 through 25 (of 25 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    I think you misunderstand what the problem is.

    Ajax is a technique to load data in the background without refreshing the page, which is what my plugin does once you click on the submit button. A request is send to the server, it returns store data and only that part of the html is replaced.

    The same technique is used by other ( probably all ) store locator plugins out there, mine is no different.

    So the problem is not caused by the way my plugin loads store data, or any others. It’s caused by your theme ( or any other theme ) using Ajax not just to load a small piece of data, but the entire page ( which as you notice can cause other issues ).

    When that happens the code that is used to detect when the document is ready fails ( html page finished loading ), because it’s never “ready” since no normal reload ever occurred. Instead it just replaced all the content.

    If you open the /js/wpsl-gmap.js you see at the top the document.ready code, that is never triggered on your page when you use the navigation. It just replaces the html so “ready” is never reached, which it does when you just F5.

    I had one other user that had this problem, but he just disabled the Ajax navigation on the settings page in his theme.

    I will let you know if I find a solution to this problem.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    I found something that ‘could’ fix it, but I don’t have your theme myself to test it on.

    If you open the /frontend/class-frontend.php, then on line 181 you see this ( assuming you are using 1.2.23 )

    wp_enqueue_script( 'wpsl-js', WPSL_URL.'js/wpsl-gmap.js', array( 'jquery' ) );

    Change that into this.

    wp_enqueue_script( 'wpsl-js', WPSL_URL.'js/wpsl-gmap.js', array( 'jquery' ), false, true );

    Then open the /js/wpsl-gmap.js file and replace the code on line 1 with this.

    (function($){

    And the last line of code at the bottom of the file with this.

    })(jQuery);

    Let me know if that fixes it or not. I will be gone for the weekend, so not sure if I can reply quickly.

    Thread Starter itsdps

    (@itsdps)

    I was able to chat with the theme developer and found a solution in the theme itself – now your plugin works great. Thank you so much for your help and providing us all with such a fantastic store locator plugin ??

    Plugin Author Tijmen Smit

    (@tijmensmit)

    What did you change in the theme to make it work?

    Hi Tijmen,

    I’ve been following this thread as my installation hasn’t worked since I upgraded to WordPress 4.0. However this latest suggestion you have made has fixed the issue, thanks very much.

    Chris

    Plugin Author Tijmen Smit

    (@tijmensmit)

    @chrislomas Even though it’s working now, is your site also using Ajax to load entire pages? What is the url of your site?

    Hi Timjen,

    No I don’t believe it is.

    https://www.amoralia.com/stockists/

    Thanks,

    Chris

    Hi there!
    I am using your store locator plug in but it is not showing on mac, showing a big grey rectangle when we goto the page. any ideas ?

    thanks a ton for your help.

    mita

    Plugin Author Tijmen Smit

    (@tijmensmit)

    @paromita87 what is the url?

    Hi Tijmen,

    Thanks, here you go –
    https://s577467547.websitehome.co.uk/ashram-contact-details

    Regards,
    Mita

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Map won't display’ is closed to new replies.