Has anyone implemented a hierarchical category system?

Options
Looking for advice.... How can one implement a hierarchical category system where one can search for items in the parent category and match all items in any of the child categories?

Example:

Clothing
| -> Hats
     | -> Baseball Cap
     | -> Fedora
     | -> Stetson
| -> Jackets
     | -> Bomber
     | -> Denim
     | -> Windbreaker

Here are some of the things I want to be able to do....

(1) I want to give the user the ability to select "Hats" and get all hats regardless of whether they are baseball caps, fedoras, or Stetsons.

(2) If the user selects "Clothing," then the user will get all items in each of the above listed child categories. 

(3) If the user selects just denim jackets, only denim jackets are returned and not other types of jackets or clothing.

Thank you!

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    If there are only 2 levels, then it is much easier to do. If you have multiple levels, then it becomes more difficult - still doable but not trivial.

    We can go over this during office hours.
  • Alejandro Balari
    Options
    Please share how one would accomplish this on the community pages as not everyone can attend office hours 🙂