Re-Order Search Fields

Home Forums Store Locator Plus Re-Order Search Fields

This topic contains 2 replies, has 2 voices, and was last updated by  Lance Cleveland 4 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12226

    ratputin
    Participant

    I was wondering if there is a way to reorder the search fields. Currently, my fields are ordered in the following manner:

    City
    State
    Category
    Products (tag)
    Zip Code
    Within (radius)

    I would like them to be:

    Category
    Products
    City
    State
    Zip Code
    Within

    I was going to have a go at slp-pro.php, but wanted to check here first.

    TIA
    Rat

    • This topic was modified 4 years ago by  ratputin.
    #12245

    ratputin
    Participant

    UPDATE:
    I *may* have found my own solution. I have done the following:

    Edited slp-pro.php (lines 367 – 370) to be:

            add_filter('slp_search_form_divs',array($this,'filter_SearchForm_AddCityPD'     ),20);
            add_filter('slp_search_form_divs',array($this,'filter_SearchForm_AddStatePD'    ),30);
            add_filter('slp_search_form_divs',array($this,'filter_SearchForm_AddCountryPD'  ),40);
            add_filter('slp_search_form_divs',array($this,'filter_SearchForm_AddTagSearch'  ),10);

    and edited slp-tagalong.php (lines 249 – 253) to be:

                if ($this->options['show_cats_on_search']==='on'){
                    add_filter('slp_search_form_divs',
                            array($this,'filter_AddCategorySelectorToSearchForm'),
                            5
                            );

    In short, I changed the numerical value to correspond to the order I wanted. I am no php expert, so now the question…will these edits have any undesirable consequences (other than needing to be remade after updates)?

    TIA
    ~Rat

    Attachments:
    You must be logged in to view attached files.
    #12281

    Lance Cleveland
    Keymaster

    That is a good way to do it, but you should investigate creating your own custom add-on pack if you are using hooks and filters.

    BTW, SLP4 and the related add-on packs will be providing full layout control over all elements:

    Pro Pack : overall page layout, the order the search form, map, and results blocks appear.

    Enhanced Search : layout of the search form

    Enhanced Map : layout of the map and the info bubble

    Enhanced Results : layout of the results

    The primary goal of SLP4 is to allow for very customized user experiences without writing/hacking code. Update a few admin boxes and create some CSS rules and you can avoid coding.

    Some of it has been documented in the videos. I’ll be adding a few more videos to the online docs page shortly.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.