1

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 and red is a term
  • Do you mean color is taxonomy and red is a term? Are you using ajax? – Bikash Waiba Jun 17 '17 at 16:22
  • Yes and yes. I also edited the question. – jack Jun 17 '17 at 16:44
  • it would be better if you post some code in your question such as html markup, ajax function etc you have tried or you want. – Bikash Waiba Jun 17 '17 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.