S
S
sasha7612018-02-27 17:44:39
WordPress
sasha761, 2018-02-27 17:44:39

How to make subcategories dropdown list in Woocommerce?

In general, on my wordpress site, I made the output of categories and subcategories in my sidebar and was able to make the subcategories drop-down list. Here is the site itself , click on the link "electrical cabinets" - there will be a toggle effect on the subcategories.
Here is the JS code:

$(function() {
  $('.product-categories .cat-parent').children('a').click(function() {
    $(this).siblings('.children').slideToggle();
    return false;
  });
});

ul.children{
  display: none;
}

The essence of the question is this: how will the user understand that this is an unfolding list?
And as I understand it, the solution should be to insert this element into the category template
<span><i class="fa fa-angle-down" aria-hidden="true"></i></span>

But I don't know where this file is; and even if I find it, I don't know exactly how to edit it. Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sasha761, 2018-02-27
@sasha761

https://robotoman.ru/ here is an example of a site on which this function is implemented (the categories are located almost at the footer)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question