diff --git a/admin/themes/default/template/controllers/products/helpers/list/list_content.tpl b/admin/themes/default/template/controllers/products/helpers/list/list_content.tpl index 33dfacfc2..c08f0e2aa 100644 --- a/admin/themes/default/template/controllers/products/helpers/list/list_content.tpl +++ b/admin/themes/default/template/controllers/products/helpers/list/list_content.tpl @@ -22,11 +22,28 @@ {block name='td_content'} {if isset($tr.$key) && isset($params.position)} {if $order_by == 'position' && $order_way != 'DESC'} -
-
- {$tr.$key.position + 1} + {assign var=filters_has_value_no_location_hotel value=false} + + {foreach $fields_display AS $key => $params} + {if $key != 'id_category_default' && (isset($params['value']) && $params['value'] !== false && $params['value'] !== '')} + {if is_array($params['value']) && trim(implode('', $params['value'])) == ''} + {continue} + {/if} + + {assign var=filters_has_value_no_location_hotel value=true} + {break} + {/if} + {/foreach} + + {if !$filters_has_value_no_location_hotel} +
+
+ {$tr.$key.position + 1} +
-
+ {else} + {$tr.$key.position + 1} + {/if} {else} {$tr.$key.position + 1} {/if} diff --git a/admin/themes/default/template/controllers/products/helpers/list/list_header.tpl b/admin/themes/default/template/controllers/products/helpers/list/list_header.tpl index 89833bf72..8c1726d7f 100644 --- a/admin/themes/default/template/controllers/products/helpers/list/list_header.tpl +++ b/admin/themes/default/template/controllers/products/helpers/list/list_header.tpl @@ -111,32 +111,24 @@ {/if} - {else if $params.type == 'select'} - - {$params['title']|escape:'html':'UTF-8'}: {$params['list'][$params['value']]|replace: ' ' : ''} - - - {else if $params.type == 'select_multiple_and'} - - {$params['title']|escape:'html':'UTF-8'}: - - {foreach from=$params.value item=option name=foreachInfo} - {$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}, {/if} - {/foreach} + {elseif $params.type == 'select'} + {if isset($params.multiple) && $params.multiple} + + {$params['title']|escape:'html':'UTF-8'}: + + {foreach from=$params.value item=option name=foreachInfo} + {$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}{if $params.operator == 'or'} | {else}, {/if}{/if} + {/foreach} + + - - - {else if $params.type == 'select_multiple_or'} - - {$params['title']|escape:'html':'UTF-8'}: - - {foreach from=$params.value item=option name=foreachInfo} - {$params.list[$option]}{if !$smarty.foreach.foreachInfo.last} | {/if} - {/foreach} + {else} + + {$params['title']|escape:'html':'UTF-8'}: {$params['list'][$params['value']]|replace: ' ' : ''} + - - - {else if $params.type == 'bool' && $key == 'advance_payment'} + {/if} + {elseif $params.type == 'bool' && $key == 'advance_payment'} {$params['title']|escape:'html':'UTF-8'}: {if $params['value'] == 1}{l s='Yes'}{elseif $params['value'] == 0}{l s='No'}{/if} @@ -245,32 +237,26 @@
{elseif $params.type == 'select'} - {if isset($params.filter_key)} - {if isset($params.list) && is_array($params.list)} {foreach $params.list AS $option_value => $option_display} - + {/foreach} {/if} + {else} + {if isset($params.filter_key)} + + {/if} {/if} - {elseif $params.type == 'select_multiple_and'} - - {elseif $params.type == 'select_multiple_or'} - {else} {/if} @@ -312,7 +298,7 @@ $('#list_filters_panel').find('[name*="'+$(this).parent().data('filter_key')+'"]').val(''); } else if (type == 'range') { $('#list_filters_panel').find('[name*="productFilter_'+$(this).parent().data('filter_key')+'"]').val(''); - } else if (type == 'select' || type == 'select_multiple_and' || type == 'select_multiple_or') { + } else if (type == 'select') { $('#list_filters_panel').find('select[name*="productFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false); } else if (type == 'bool' && $(this).parent().data('filter_key') == 'advance_payment') { $('#list_filters_panel').find('select[name*="productFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false); @@ -329,6 +315,17 @@ form.submit(); }); + + $('#form-product').submit(function () { + let form = $(this); + $(form).find('select[multiple]').each(function (i, selectElement) { + if ($(selectElement).val() == null) { + $(form).append(''); + } + }); + + return true; + }); });