WordPress.org

Ready to get started?Download WordPress

Forums

SimpleMap Store Locator
How to display the country in SimpleMap? (5 posts)

  1. Alberg15
    Member
    Posted 2 years ago #

    Everything looks great, except that I can't seem to display the country name. The country field collects the data in the Add-a-Location window. But then the country name does not display as part of the address in the listing below the map display, nor in the Info Bubble. The only options I see are in the Address Format drop down, and they do not include a country field. [city/town] - [state/province] [zip/postal code]. Is there a way to add [country] to this selection? thanks-ab

  2. zigmas
    Member
    Posted 2 years ago #

    I´m trying to do the same... I know that has something to do with the simplemap.php on .../plugins/simplemap/classes/ but i cant manage it to work. I also need to make a search TD for it...

    :/ is so basic yet so not there.

  3. belgianwolfie
    Member
    Posted 2 years ago #

    ../plugins/simplemap/classes/simplemap.php

    do a search for this string : <address>

    You 'll see there are 7 entries for <address>
    Pick the one that you currently have set in your admin (you could also put some debug text in all of them and print them out to see what displays on the front-end

    and then just add 'country' to that line

    like so
    html += '<br />' + city + ', ' + state + ' ' + zip + '(' + country + ')</address></div>';

    Mind you : this just adds the SHORTCODE of the country (like ES for Spain) etc ...
    if you want the full country code you'de have to convert those shortcodes to full country names first obviously ...

  4. Matthew Sigley
    Member
    Posted 1 year ago #

    I know this post is old but this is information that should be in the forum.

    To add the Country field into the search form (all the code already exists for this functionality, but for some reason it is disabled by default), one must use one of the many undocumented shortcode attributes.

    [simplemap search_fields=labelbr_street||labelbr_city||labelbr_state|| labelbr_zip||labelbr_country||empty||labeltd_distance||empty]

    You can take a look at all of the shortcode attributes in simplemap.php by looking at the get_default_shortcode_atts function.

    P.S. I don't know why the developer doesn't provide some basic docs for free. He should. If he wants to make money on the plugin, branch the code and create a paid version.

  5. jnscollier
    Member
    Posted 1 year ago #

    Seriously chaoix is right.... Developer - why make a plugin and provide little-to-no documentation or 'getting started' info? You clearly have the mind of a developer and not a marketer. Why sell support when you could sell much more than that?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic