Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • digitiimi Friend
    #1068640

    Hey,

    I have a big amount of products I need to filter with and I’m using Megafilter.
    Some of the product categories have child-categories.

    For example:
    I select Category 1 and it has a child-category. I need to show this child category only if Category 1 is selected. I need to use checkboxes as I want to show all the main parent categories at the same time.
    Is this possible?

    Or is it possible to add id or class for the filter field (class="ln-element filter-field") so maybe this could be "hacked" with css and js?


    1. selected-showing-child
    2. not-selected-child-not-showing
    Mr.Cat Moderator
    #1068698

    @digitiimi

    It’s a good ideal, but now it’s impossible.

    If you have any solution, please let us know.

    Thanks

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

    digitiimi Friend
    #1072645

    I know that this is not a perfect solution but we were able to create this with JS and CSS. Example below:

    jQuery(document).on('afterUpdateRender', function (e) {
          jQuery('input[name="attr.ct12.value"][value="3"]').change(function () {
            if (!this.checked) 
            //  ^
               jQuery('.ln-element.filter-field:nth-child(4)').fadeOut('slow');
            else 
                jQuery('.ln-element.filter-field:nth-child(4)').fadeIn('slow');
        });
    });
    .ln-element.filter-field:nth-child(3), .ln-element.filter-field:nth-child(4) {display: none;}
    Mr.Cat Moderator
    #1072809

    @digitiimi

    Thanks for your solution.

    As i can see, it’s a bit hard code. What we want to achieve is making it works for all fields.

    And it kind of complicated now.

    Wisdom is not a product of schooling but of the lifelong attempt to acquire it.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 3 replies, has 2 voices, and was last updated by  Mr.Cat 6 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum