Support » Plugin: WP Store Locator » Saving a new store generates the wrong lat lon

  • Resolved Tim

    (@brugman)


    Hi.

    When I enter just the required fields and Publish the post the lat lon generated contains a comma. With a comma it won’t show the map in the sidebar, and on the frontend it shows up on the map at 0 0.

    When I hit the button on the sidebar preview however, the lat lon is generated with a period, and everything works great!

    Is this just on my site, or an actual bug?

    Thanks!

    Screenshots:
    Before saving.
    After saving.
    After the sidebar preview button.

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

    (@tijmensmit)

    This is something I have never seen before. The coordinates returned by the Google Geocode API contains a . and not a ,. This value isn’t changed by the store locator.

    Are you comfortable with code to test something?

    Tim

    (@brugman)

    Sure!

    Plugin Author Tijmen Smit

    (@tijmensmit)

    If you run this code, what does it show for the ‘decimal_point’ value?

    print_r(localeconv());

    Tim

    (@brugman)

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Can you before line 28 add the code below and let me know if that fixes it?

    setlocale( LC_NUMERIC, 'en_US.UTF-8' );

    It does!

    This particular site is on a server I don’t own and have limited access to, so it may be a funky setup. Thanks for the custom patch!

    • This reply was modified 3 weeks, 3 days ago by  Tim.
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.