Hi.
I want the product filter to hide the options in the filter after choosing the option you want. How can i do this?
See attachment for illustration
You should edit the following file:
design\themes\THEME\templates\blocks\product_filters\components\product_filter_variants.tpl
and replace:
```php
```
with
```php
```
and
```php
```
with
```php
```
and
```php
```
with
```php
```
That worked but it also hid the rest of the options under the other filters.
Is it possible for it to just hide the “Bilmerke” options?
You are right, sorry. Try to replace:
{if $smarty.capture.has_selected}
with
{if $filter.selected_ranges}
And do not forget to clear cache
[quote name=‘eComLabs’ timestamp=‘1429191570’ post=‘211731’]
You are right, sorry. Try to replace:
<br />
{if $smarty.capture.has_selected}<br />
```<br />
<br />
with<br />
<br />
```php
<br />
{if $filter.selected_ranges}<br />
```<br />
<br />
And do not forget to clear cache<br />
[/quote]<br />
<br />
That did the trick! Thank you very much <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)">
You are welcome!
I had to do a backup because of some errors and i lost this function.. Tried now to add it again but suddenly i cant find
so i can replace it with
This is the only lines i cant find in: templates\blocks\product_filters\components\product_filter_variants.tpl
And the filter will not work as its supposed to work after editing these.
Try to skip latest changes. The corresponding line does not exist in the file on new versions
Sorry to bump - we are looking to do this in CS Cart 4.3.5 but the code above no longer appears to work. Any idea how to do it now?
Below is the original source from design\themes\THEME\templates\blocks\product_filters\components\product_filter_variants.tpl :
{if $filter.display_count && $filter.variants|count > $filter.display_count}
{script src="js/tygh/filter_table.js"}
{/if}
{* Selected variants *}
{foreach from=$filter.selected_variants key="variant_id" item="variant"}
{/foreach}
{if $filter.variants}
{foreach from=$filter.variants item="variant"}
-
{/foreach}
{/if}
Try to replace:
<li class="ty-product-filters__item-more">
with
<li class="ty-product-filters__item-more{if $filter.selected_variants} hidden{/if}">
(!) Not tested
Hello, I need this change. But the version I am using is 4.17.2. In which codes and files should I make the change suitable for this version? I request your support. I would like you to know that I am a novice in coding. Thanks in advance.
If you mean my message, I have corrected it. But the described code is not tested
Dear @ecomlabs thank you for your valuable ideas, but I tried the revision you described on my page but it didn’t work. I am adding a visual. How can I solve this problem? When I made a selection, I wanted the passive filters to be hidden. I would also like you to know that I deleted the cache folder and browser memory after the process and checked.
What theme do you use?
There are 2 themes that I prefer, the first is cs-cart responsive theme, the other is internal uni theme and currently uni theme is active.
Try to add the following code to the CSS section of the Theme editor
.cm-product-filters-checkbox-container label.disabled {
display: none !important;
}
(!) Not tested