adding text search function to the header search widget
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 28 Apr 2017 11:48:48 +0000 (07:48 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 28 Apr 2017 11:48:48 +0000 (07:48 -0400)
adding the correct name and action to the header search form in the text
input field

functions.php
sections/header.php

index 2ec93b9..fc3ecbc 100644 (file)
@@ -20,7 +20,32 @@ if (!function_exists('glm_quicksite_widget_init')) {
     }
 
 }
-
+//add_filter('glm-member-db-front-search-query', function( $queryParts ) {
+//    //$queryParts = array();
+//    if ( isset( $_REQUEST['manufacturers'] ) && is_array( $_REQUEST['manufacturers'] ) && !empty( $_REQUEST['manufacturers'] ) ) {
+//        $catSelectedForQuery = implode( ',', $_REQUEST['manufacturers'] );
+//        $queryParts[] = " T.id in (
+//                    SELECT DISTINCT(member_info)
+//                      FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."category_member_info M,
+//                           ".GLM_MEMBERS_PLUGIN_DB_PREFIX."categories C
+//                     WHERE M.category in($catSelectedForQuery)
+//                        OR (C.parent in($catSelectedForQuery) AND M.category = C.id)
+//            ) ";
+//    }
+//    // Check to see if Pre-Owned is not set. If it is not set then only get
+//    // listings without the Pre-Owned
+//    if ( !isset( $_REQUEST['pre_owned'] ) ) {
+//        $queryParts[] = " T.id IN (
+//            SELECT ref_dest
+//              FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_field_data
+//             WHERE field_data != 'Yes'
+//               AND field_id = (SELECT id
+//                                 FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_fields
+//                                WHERE field_name = 'Pre-Owned')
+//        ) ";
+//    }
+//    return $queryParts;
+//});
 /**
  * Return the client info option for the given key
  *
index a52ae4a..11c7792 100644 (file)
             <div class="row">
                 <div id="search-header" class="small-12 columns">
 <!--                   <a class="reset-search" href="">Reset Search</a>-->
-                    <form>
+                    <form action="<?php echo get_permalink(get_option("glm_members_database_option_members_list_id")); ?>?action='list'">
                         <span>Search for Trail</span>
-                        <input type="text">
+                        <input name="textSearch" type="text" method="post">
                         <input class="search-button right" type="submit" value="Search" name="submit">
                     </form>
-                    <form>
+                    <form action="<?php echo get_permalink(get_option("glm_members_database_option_members_list_id")); ?>?action='list'">
                         <span>Search by Location</span>
                         <select class="header-search" name="" id="region-search">
                             <option value="">Select a Region</option>