From 89c49a3f1a119db3dd513496cefe52fd401d802a Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 28 Apr 2017 16:47:56 -0400 Subject: [PATCH] testing seach filter changes by category adding sql queries to filter all of the header search widget category options. modifiying the search filter in the functions file that checks for the category parent for testing --- functions.php | 4 +- js/app.js | 139 +++---------------------------------- js/custom/headerSearch.js | 139 +++---------------------------------- lib/ajax-search.php | 140 +++++++++++++++++++++++++++----------- 4 files changed, 121 insertions(+), 301 deletions(-) diff --git a/functions.php b/functions.php index e78962e..f98bcac 100644 --- a/functions.php +++ b/functions.php @@ -29,8 +29,8 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ) { 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) + WHERE M.category in ($catSelectedForQuery) + ) "; } if ( isset( $_REQUEST['cities'] ) && is_array( $_REQUEST['cities'] ) && !empty( $_REQUEST['cities'] ) && $_REQUEST['cities'][0] !== '' ) { diff --git a/js/app.js b/js/app.js index b120116..65e9171 100644 --- a/js/app.js +++ b/js/app.js @@ -118,15 +118,16 @@ $(document).ready(function () { data: { action: "trailmaps", activity: activity, + others: {'destination' : $('#destination-search option:selected').val(), 'park' : $('#park-search option:selected').val()} }, success:function(data){ var activity_data = data; - + console.log(data.test); option = {}; $('#destination-search option').not(':eq(0), :selected').remove(); var selected = $('#destination-search option:selected').val(); - console.info(selected); + console.info(data); // counties.append($('