I am trying to modify Multiple Groups Filter Template
I am trying to modify the multiple group filter to allow users to select from different categories and only display results that match the criteria selected.
Users have the options to select “Plant Type” and “Lighting requirements”. For example, if I select Plant Type: Flowers
Lightning Requirements : Indoor
I want results to be returned that matches both. Which is what the code currently does. However, if I just select Plant Type: Flowers and Leaves, nothing is returned since I didn’t select an option under lighting requirements.
I need to allow for searching using AND/OR conditions. A user should be able to search within a category (OR) . For example, I should be able to select Flowers and Leaves under Plant Type and results that matches either Flowers and Leaves are returned. For the AND condition, I should be able to select Flowers and Indoor and records that matches both conditions are returned. The current example is using the AND condition.
Please let me know how I can update the code to perform the (OR) condition. Also, If I was to add a third category called Soil Type with values : clay, loam, sand and silt. I want the (OR) condition to work if I select Plant Type and Soil Type without having a value selected for Lightning Requirements.
Any help is greatly appreciated.