1. I want to create a filter with adaptive product attributes, in woocommerce.
Example: I am in product category A, I select the value red from the color filter attribute. After this, only red products are shown, but also from this point I need to show in the filters only attributes which only red-color products have.
Any ideas on how to do this?
I tried looping all red products and get their attributes, so I can hide all other unnecessary attributes. Evidently, this solution is not efficient at all.
2. Also, is there any DB query to return "All attributes of products under category A / subcategory AA ..." ?
Clarification:
- An attribute is a taxonomy and an attribute value is a term.
color
is taxonomy andred
is a term
color
is taxonomy andred
is a term? Are you using ajax?