WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] Country dropdown in search sort incorrectly

[Resolved] Country dropdown in search sort incorrectly

Viewing 9 replies - 1 through 9 (of 9 total)
  • WP version is 3.5, not 3.4.2

    you can changed that by modifying template file at wp-contents/plugins/events-manager/templates/templates/events-search.php

    e.g.
    from location_country changed to location_name

    to use templates: http://wp-events-plugin.com/documentation/using-template-files/

    Can you clarify what to change ?

    $countries = em_get_countries();
    $em_countries = $wpdb->get_results("SELECT DISTINCT location_country FROM ".EM_LOCATIONS_TABLE." WHERE location_country IS NOT NULL AND location_country != '' AND location_status=1 ORDER BY location_country ASC", ARRAY_N);

    changed ORDER BY location_country to ORDER BY location_name.

    Doesn’t work.

    if you look at the source code, you see what I explained in my first post. It gets sorted by the country abbreviations instead of the country name.

    <option value="AU" >Australia</option>
    <option value="BE" >Belgium</option>
    <option value="CA" >Canada</option>
    <option value="CZ" >Czech Republic</option>
    <option value="ES" >Spain</option>
    <option value="FI" >Finland</option>
    <option value="FR" >France</option>
    <option value="GB" >United Kingdom</option>
    <option value="US" >United States</option>

    After adding more countries, the list gets bigger and more ‘messed up’. I think it can be fixed by changing the following:
    line 64 in events-search.php

    ORDER BY location_country ASC

    to

    ORDER BY location_something ASC

    where something is a variable I don’t know.
    Who has the solution ?

    Just checked in phpmyadmin to which values are available.
    The country as a full name is not store in the database and therefor not sortable (afaik).

    I would recommend to insert the column which holds the full name/title from a country so it can be sorted on that field instead of on location_country.

    Hope Marcus reads this.

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    good point… will fix this asap.

    Good to hear.

    Marking this topic resolved.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Country dropdown in search sort incorrectly’ is closed to new replies.
Skip to toolbar