9de1306c21
After the change that registers variation attributes as terms (in addition to reigstering them as post meta) it is now time to modify the get_filtered_term_product_counts methods in WC_Widget_Layered_Nav so that it works consistently for both variable and non-variable products. The logic for the counters is now as follows: with OR operator: - Simple products: count the attributes of all visible products (unchanged behavior). - Variable products: count attributes corresponding to visible variations. with AND operator: - Simple products: count the attributes of visible products but only for products that have all the selected (unchanged behavior). - Variable products: find all the products for which all the variations corresponding to the selected attributes exist and are visible, then count the attributes corresponding to the visible variations of those products. A product is "visible" if it's published, not excluded for catalog, and has stock. Additionally, a variable product will not be considered visible if the parent product is not. |
||
---|---|---|
.. | ||
class-wc-widget-cart.php | ||
class-wc-widget-layered-nav-filters.php | ||
class-wc-widget-layered-nav.php | ||
class-wc-widget-price-filter.php | ||
class-wc-widget-product-categories.php | ||
class-wc-widget-product-search.php | ||
class-wc-widget-product-tag-cloud.php | ||
class-wc-widget-products.php | ||
class-wc-widget-rating-filter.php | ||
class-wc-widget-recent-reviews.php | ||
class-wc-widget-recently-viewed.php | ||
class-wc-widget-top-rated-products.php |