changing manufacturers field name
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 14 Apr 2017 17:35:14 +0000 (13:35 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 14 Apr 2017 17:35:14 +0000 (13:35 -0400)
changing the manufacturers search field name to manufacturers to make it
easier to block it from search results if there are brands present in the list

glm-member-db/views/front/members/list.html

index 085ce12..1e1e828 100644 (file)
@@ -2,7 +2,6 @@
     {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}
 ">
-
 {include file='front/members/header.html'}
         {apply_filters('glm-member-db-front-members-list-pageTop', '')}
 <div class="glm-member-list-inner-wrapper">
                                     </select>
                                 {/if}
                             </div>
+          
+                            {if !empty($smarty.post.manufacturers)}
+                                {foreach $smarty.post.manufacturers as $key=>$value}
+                                    {$manufacturers[] = $value}
+                                {/foreach}
+                            {/if}
+                 
                              {$manufacturer_ids=apply_filters('manufacturer_ids', '')}
                             {if $settings.list_show_search_category}
                                 {$rvTypes = array()}
@@ -50,9 +56,7 @@
                                 {/foreach}
                                 <div>
 
-                                    {foreach $manufacturer_ids as $manufacturer_id}
-
-                                    {/foreach}
+                                
                                     <select name="categorySearchMultiple[]" id="rvTypes" title="Click to Select Types" multiple="multiple">
                                         {foreach $rvTypes as $item => $v}
                                         <option value="{$v.id}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
                                 <hr>
                             </div>
                         </form>
+            
                         <form id="manufacturer-form" action="{$thisUrl}?glm_action=list" method="post" enctype="multipart/form-data">
                             {if $settings.list_show_search_category}
                                 <div>
                                     Manufacturers:
-                                    <select name="categorySearchMultiple[]" id="rvManufacturers" title="Click to Select Types" multiple="multiple">
+                                    <select name="manufacturers[]" id="rvManufacturers" title="Click to Select Types" multiple="multiple">
                                         {foreach $rvManufacturers as $item => $v}
-                                        <option value="{$v.id}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
+                                        {if !empty($manufacturers)}
+                                             <option value="{$v.id}"{if $v.id|in_array:$manufacturers} selected="selected"{/if}>{$v.name}</option>
+                                        {else}
+                                             <option value="{$v.id}">{$v.name}</option>
+                                        {/if}
                                         {/foreach}
                                     </select>
                                 </div>
                     $("#rvManufacturers").prev().prev().prop("disabled",false);
                 }
             });
-            $('#manufacturer-form').submit(function(e){
-                if( $('#brands').prev().children('li').length > 0 ){
-                    $('#rvManufacturers option').remove();
-                }
-
-            });
+                
+//            $('#manufacturer-form').submit(function(e){
+//                if( $('#brands').prev().children('li').length > 0 ){
+//                    $('#rvManufacturers').removeAttr('name');
+//                }
+//       
+//            });
 
 
             jQuery('select[multiple]').asmSelect();
-
-            if( $('#brands').prev().children('li').length > 0 ){
-               $("#rvManufacturers").prev().prev().prop("disabled","disabled");
-            }
+            
+       
+                
+//            if( $('#brands').prev().children('li').length > 0 ){
+//               $("#rvManufacturers").prev().prev().prop("disabled","disabled");
+//            }
 
             if( $('#rvManufacturers').prev().children('li').length > 0 ){
-
-                 $('#brands option').remove();
+                
+                $('#brands option').remove();  
                 var brands      = [];
                 var cat_id = $('#rvManufacturers').val();
+                
                 $.each(cat_id, function(index, item){
                     var select_id = item;
                     $.each(categories , function(index, item){