Here is a jQuery solution for a WooCommerce accordion style menu for the product category menu that can be assigned with a WooCommerce widget, the menu works best when all product categories are assigned to a parent category.

The Accordion menu will then expand and collapse on click with the first parent category appearing expanded, the count span also has a link to the child category archive page. I have come across the original code (which I have modified)  on a site with no credit/author reference.

The toggle icons have been marked up with FontAwesome5 regular free icons, so either have that loaded or change the markup for something else.

4 Comments

  1. Mark on March 27, 2020 at 9:22 pm

    I couldn’t get this to work.

  2. Mark on March 27, 2020 at 9:11 pm

    Have you or anybody else ever taken the filters from WC and made those into an Accordion?

    I’ve been looking and looking and can’t find anything. Thanks in advance!

  3. Lance on February 24, 2020 at 2:32 am

    Appreciate the tip. Worked great for me!

  4. D on February 28, 2019 at 4:35 pm

    Sweet, works lika a charm.
    -How to keep them all closed by default?

Leave a Comment