Category Filter Options

Divi Ajax Filter (and BodyCommerce/Machine) offer some clever ways to help you display the categories the way you want.

Once you have chosen "Category" as the thing you want to filter, head over to the Category Filter Options tab

General

  1. Choose what Categories you want to display
    1. Only Parent Categories
    2. Only Sub Categories of Selected Category (you then define the slug of the parent category below)
    3. Sub Categories of the current category (this is when you are on the category page itself)
    4. All (default)

  2. Parent slug (when selecting option b above)
  3. Only show subcategories - enable this to only show the subcategories of the selected (when selection option b above)
  4. Sub Category Prefix (when choosing to display parent and sub) - this will prefix the subcategory to indicate that it is a child
  5. Make the subcategories collapsible

Conditional Categories

If you want to have two filters and one be updated based on the selection of the parent categories you can do this.

Step 1: Add Parent Category Filter

Add the parent category filter.

1) Define it to ONLY show parent categories

2) Set the Conditional ID and Name to what you want

Step 2: Add a Subcategory Filter

1) It does not matter what type you set it to - just have it as "show all" for the category display mode

2) Define the Logic

Enable the logic and make sure these conditions are met

  • Relation = ALL
  • Parent Category (defined above) does not equal
  • Parent Category (defined above) is not empty

Now this filter will be updated based on the parent category selection.

Watch a video here to explain more

Still need help? Contact Us Contact Us