50e8f27bc7
The layered nav filtering doesn't work well with variable products when some variations have stock and other don't. When a term is selected in the widget, a variable product having no stock for the variation corresponding to that term but having stock for other variations will be displayed, but it shouldn't. This commit fixes that by introducing two changes: - A new override of "is_visible" for WC_Product_Variable that looks at the supplied filters, compares them against the corresponding available variations and calculates the visibility based on the query type (OR or AND). - A hook on the "found_posts" filter in WC_Query, that adjusts the posts count based on the found products visibility when there are filters available; this is needed to sync the "displaying X posts" messages and the paging when variable products are hidden due to stock status. Additionally, the visibility calculated in "found_posts" is cached as loop variables so that it isn't calculated again when actually displaying the products. |
||
---|---|---|
.. | ||
api-functions.php | ||
class-wc-rate-limiter.php | ||
class-wc-tests-core-functions.php | ||
class-wc-tests-user-functions.php | ||
class-wc-tests-wc-query.php | ||
conditional-functions.php | ||
deprecated-hooks.php | ||
dummy-wc-logger.php | ||
install.php | ||
notice-functions.php | ||
plugin-updates.php | ||
validation.php |