Hide Option In Product Filter After Choosing

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

hide options.jpg

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?

    hide options-2.jpg

    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:

  • with

  • (!) Not tested