From 43e610a2220a2f7de760861809c35d42e8288f2c Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 14 Apr 2017 08:26:44 -0400 Subject: [PATCH] search widget filtering and validation disabled the manufacturers dropdown if there are brands selected. removing manufacturers from the form submission if there are brands. brands repopulate once all manufacturers are removed from the list selection. all js code is in the list.view file in the theme --- functions.php | 2 + glm-member-db/views/front/members/list.html | 129 +++++++++++++++++--- 2 files changed, 116 insertions(+), 15 deletions(-) diff --git a/functions.php b/functions.php index 8e3fd4c..abb7dbc 100644 --- a/functions.php +++ b/functions.php @@ -20,9 +20,11 @@ if (!function_exists('glm_quicksite_widget_init')) { } add_filter('manufacturer_ids', function(){ +// // $ids = [3,11]; // Anthony's test ids - remove before go-live $ids = [165,143,140,178,149,224]; // ids of manufacturer categories on dev55 // $ids = [16,11,19]; // Laury's test ids - remove before go-live + return $ids; }); /** diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index 232fe0c..bfe7966 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -2,7 +2,7 @@ {if $settings.list_map_show_opened}map-opened{else}map-closed{/if} {if $settings.list_show_search_filters_opened}filters-opened{else}filters-closed{/if} "> -{$customQueryParams = apply_filters('glm-member-db-fields-front-list-query-params', '')} + {include file='front/members/header.html'} {apply_filters('glm-member-db-front-members-list-pageTop', '')}
@@ -70,7 +70,7 @@
-
+ {if $settings.list_show_search_category}
Manufacturers: @@ -208,17 +208,17 @@
{if $settings.list_show_search_alpha} {/if} {if $paging}
- Previous page - Next page + Previous page + Next page
showing {$start} through {$lastDisplayed} of {$filteredMembersFound} {/if} @@ -368,8 +368,8 @@ {if $paging}

- Previous page - Next page + Previous page + Next page
showing {$start} through {$lastDisplayed} of {$filteredMembersFound}
@@ -387,13 +387,7 @@ $('.glm-member-list-record').each(function(){ if( $(this).find('.slash-price').length != 0 ){ $(this).find('.msrp-value').addClass('sale'); -// $(this).find( $('.sale-price-value') ).insertAfter( $(this).find('.sale') ).css('display', 'block').css('float', 'right').addClass('sale-text'); - } - }); - - $('.glm-member-list-record').each(function(){ - if( $(this).find('.slash-price').length != 0 ){ - $(this).find('.msrp-value').css('color','black').css('text-decoration','none').removeClass('glm-columns').wrap('
'); + $(this).find( $('.sale-price-value') ).insertAfter( $(this).find('.sale') ).css('display', 'block').css('float', 'right').addClass('sale-text'); } }); @@ -405,6 +399,111 @@ $(this).css("display", "block"); }); + // var cat_ids = []; +// $.fn.manufacturer_brand = function(){ +// +// $(this).on("change", function(){ +// var _ = $(this); +// +// var cat_names = []; +// var cat_id = _.val(); +// var el_id = _.attr('id'); +// var cats = _.prev().find('span'); +// +// cat_ids.push(cat_id); +// +// cats.each(function(){ +// cat_names.push(_.text()); +// }); +// + var cat_ids = []; + var selected_brands = []; + var all_brands = '{$brands|@json_encode}'; + all_brands = JSON.parse(all_brands); + var categories = '{$categories|@json_encode}'; + categories = JSON.parse(categories); + + $('#rvManufacturers').on("change", function(){ + + var _ = $(this); + var brands = []; + var cat_names = []; + var cat_id = _.val(); + var el_id = _.attr('id'); + var cats = _.prev().find('span'); + $('#brands option').remove(); + + if( cat_id ){ + + } else { + $.each(all_brands, function(index, item){ + {literal} var option = $('