This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Product categories, Product Tags & Keyword filter not working in …
…Products block (#8377) * Fix product categories & keyword filter not working * Fix Product tags filter not working * Make code readable by creating functions for the different parts of the query. Functions: - get_filter_by_product_categories_or_tags_query - get_filter_by_keyword_query Also rename the function `get_queries_by_attributes` to `get_queries_by_custom_attributes` to make it more clear what it does. * Make function generic by including all taxonomies As user can add custom taxonomies, we need to make sure that we include all taxonomies in the query. To fetch all product taxonomies, I used following function: ```php get_taxonomies( array( 'object_type' => array( 'product' ) ), 'names' ) ``` * Minor improvements based on PR feedback * Move null check for tax_query to function
- Loading branch information
1 parent
db6c7bc
commit 7f3b64b
Showing
1 changed file
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters