nicolas wrote: Hi,
1. Since the filters have the "dynamic display" setting activated (I presume), it means that each filter only display the choices matching what is preselected in the other filters.
If you don't display the clear button, then once you selected a combination of choices which has no results, you'll not be able to unselect any filters. In order to avoid that, once dynamic filters don't have any results they deactivate their "dynamic display" setting until their are results again.
If you don't want that, then you'll have to change the code.
I think changing that code:
if(!empty($filter->filter_options['custom_field']) && !empty($datas['products'])){
to:if(!empty($filter->filter_options['custom_field'])){
in the file administrator/components/com_hikashop/classes/filter.php should do it.
it is pitty but it dont work
let me explain one more time the bug
I have 6 customs fields
in each of custom field i store different values for filtering for a different categories of products because i dont want to make my products table
in db big (this method said to me one of yours comrade on this forum)
here is an example code on loaded page
<SELECT size=2 name="filter___49" id="filter___49_hikashop_category_information_module_">
<OPTION VALUE="none" selected>Temp range</OPTION>
<OPTION name="custom_field" value="0">No data</OPTION>
<OPTION name="custom_field" value="311">-50...+50 °С</OPTION>
<OPTION name="custom_field" value="310">-50...+85 °С</OPTION>
<OPTION name="custom_field" value="300">-50...+100 °С</OPTION>
<OPTION name="custom_field" value="301">-50...+120 °С</OPTION>
<OPTION name="custom_field" value="303">-50...+150 °С</OPTION>
<OPTION name="custom_field" value="304">-50...+180°С</OPTION>
<OPTION name="custom_field" value="309">-50...+200 °C</OPTION>
<OPTION name="custom_field" value="305">-60...+250 °С</OPTION>
<OPTION name="custom_field" value="308">-50...+500 °С</OPTION>
</SELECT>
It works good as it should - it shows only values for a category temp sensors
also for all of my other filters for this category the are contain dynamic data for products
if i will enable filter one by one - it works good dynamic data will show only variants for filter applied
but is I choose two or more filters and the result of such sql query will return null rows in this case i will get follow <SELECT> tag for my 1st filter in the example
<SELECT size=2 name="filter___49"
id="filter___49_hikashop_category_information_module_">
<OPTION VALUE="none" selected>Temp range</OPTION>
<OPTION name="custom_field" value="0">No data</OPTION>
<OPTION name="custom_field" value="1">Normally closed</OPTION>
<OPTION name="custom_field" value="2">Normally open</OPTION>
<OPTION name="custom_field" value="3">Inductive</OPTION>
<OPTION name="custom_field" value="4">Capacitive</OPTION>
<OPTION name="custom_field" value="5">Ultrasonic</OPTION>
<OPTION name="custom_field" value="6">Оптический диффузный</OPTION>
<OPTION name="custom_field" value="7">Немеханический магнитный</OPTION>
<OPTION name="custom_field" value="8">Оптический ретрорефлекторный</OPTION>
<OPTION name="custom_field" value="9">Оптический барьерный</OPTION>
<OPTION name="custom_field" value="2001">0.0025 МПа</OPTION>
<OPTION name="custom_field" value="10">0.016 МПа</OPTION>
<OPTION name="custom_field" value="11">0.025 МПа</OPTION>
<OPTION name="custom_field" value="12">0.04 МПа</OPTION>
<OPTION name="custom_field" value="13">0.06 МПа</OPTION>
<OPTION name="custom_field" value="14">0.1 МПа</OPTION>
<OPTION name="custom_field" value="15">0.16 МПа</OPTION>
<OPTION name="custom_field" value="16">0.25 МПа</OPTION>
<OPTION name="custom_field" value="17">0.4 МПа</OPTION>
<OPTION name="custom_field" value="18">0.6 МПа</OPTION>
<OPTION name="custom_field" value="19">1.0 МПа</OPTION>
<OPTION name="custom_field" value="20">1.6 МПа</OPTION>
<OPTION name="custom_field" value="21">2.5 МПа</OPTION>
<OPTION name="custom_field" value="22">4.0 МПа</OPTION>
<OPTION name="custom_field" value="23">6.0 МПа</OPTION>
<OPTION name="custom_field" value="24">10.0 МПа</OPTION>
<OPTION name="custom_field" value="25">16.0 МПа</OPTION>
<OPTION name="custom_field" value="26">25.0 МПа</OPTION>
<OPTION name="custom_field" value="27">40.0 МПа</OPTION>
<OPTION name="custom_field" value="28">1,5 кВт</OPTION>
<OPTION name="custom_field" value="29">3 кВт</OPTION>
<OPTION name="custom_field" value="30">4 кВт</OPTION>
<OPTION name="custom_field" value="31">5,5 кВт</OPTION>
<OPTION name="custom_field" value="32">7,5 кВт</OPTION>
<OPTION name="custom_field" value="33">11 кВт</OPTION>
<OPTION name="custom_field" value="34">15 кВт</OPTION>
<OPTION name="custom_field" value="35">18,5 кВт</OPTION>
<OPTION name="custom_field" value="36">22 кВт</OPTION>
<OPTION name="custom_field" value="37">30 кВт</OPTION>
<OPTION name="custom_field" value="38">37 кВт</OPTION>
<OPTION name="custom_field" value="39">45 кВт</OPTION>
<OPTION name="custom_field" value="40">55 кВт</OPTION>
<OPTION name="custom_field" value="200">Красный</OPTION>
<OPTION name="custom_field" value="201">Желтый</OPTION>
<OPTION name="custom_field" value="202">Зеленый</OPTION>
<OPTION name="custom_field" value="203">Синий</OPTION>
<OPTION name="custom_field" value="204">Белый</OPTION>
<OPTION name="custom_field" value="311">-50...+50 °С</OPTION>
<OPTION name="custom_field" value="310">-50...+85 °С</OPTION>
<OPTION selected="selected" name="custom_field" value="300">-50...+100 °С</OPTION>
<OPTION name="custom_field" value="301">-50...+120 °С</OPTION>
<OPTION name="custom_field" value="302">-50...+125 °С</OPTION>
<OPTION name="custom_field" value="303">-50...+150 °С</OPTION>
<OPTION name="custom_field" value="304">-50...+180°С</OPTION>
<OPTION name="custom_field" value="309">-50...+200 °C</OPTION>
<OPTION name="custom_field" value="305">-60...+250 °С</OPTION>
<OPTION name="custom_field" value="306">-50...+300 °С</OPTION>
<OPTION name="custom_field" value="307">-50...+450 °С</OPTION>
<OPTION name="custom_field" value="308">-50...+500 °С</OPTION>
<OPTION name="custom_field" value="400">5 А</OPTION>
<OPTION name="custom_field" value="401">10 А</OPTION>
<OPTION name="custom_field" value="402">15 А</OPTION>
<OPTION name="custom_field" value="403">25 А</OPTION>
<OPTION name="custom_field" value="404">40 А</OPTION>
<OPTION name="custom_field" value="405">60 А</OPTION>
<OPTION name="custom_field" value="406">80 А</OPTION>
<OPTION name="custom_field" value="407">100 А</OPTION>
<OPTION name="custom_field" value="408">120 А</OPTION>
<OPTION name="custom_field" value="409">150 А</OPTION>
<OPTION name="custom_field" value="410">200 А</OPTION>
<OPTION name="custom_field" value="411">250 А</OPTION>
<OPTION name="custom_field" value="412">600 А</OPTION>
<OPTION name="custom_field" value="413">800 А</OPTION>
</SELECT>
as you can see it now html element SELECT contains all data witch i store in custom field associaed to this filter also for all filters on category
also for internal filter by brand it will contain all brands in hikashop
But the normal result for this user's operation have to be something like 'sorry no data to display, please choose another combination of filters'
and show in html SELECT element user's selected values or to flush all filters and fill them only values associated to fields
I hope you understand me