This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Filter data count mismatch > Create the get_attribute_and_meta_counts method #8563
Labels
block: filter by attribute
Issues related to the Filter by Attribute block.
type: bug
The issue/PR concerns a confirmed bug.
To solve the filter data count mismatch problem as described in the epic woocommerce/woocommerce#42466 , we need to create a new method to be responsible for manipulating the data received from the product meta and attribute queries (segments 4, 5 and 6, to be developed on #8561 and #8562) and return the final count, as represented by segments 1, 2 and 3 of the main query:
This macro query is the one responsible for ensuring the returned values are compared, counted, and correctly formatted. It is the one that, in this scenario, represents the updated version of our get_attribute_counts.
The output of this function should be the same as the pre-existing
get_attribute_counts
:array termId=>count pairs
We should rely on pre-existing functionality from the core of Woo whenever possible and follow the best WordPress practices when structuring the new method and queries.
This method can be initially placed within the ProductQueryFilters class, with the possibility to be migrated upstream later on to the core of Woo (to be worked as part of a separate issue).
As soon as the implementation is complete, we should extensively test the filters on the FE with different combinations to confirm everything works as expected.
The text was updated successfully, but these errors were encountered: