woocommerce/templates
Nestor Soriano 50e8f27bc7 Fix visibility of variable products with layered nav filtering.
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.
2020-07-28 08:55:52 +02:00
..
auth Update template versions for 4.3. 2020-07-04 21:57:39 +02:00
cart Merge branch 'fix/26780' of https://github.com/priyankabehera/woocommerce into priyankabehera-fix/26780 2020-07-01 18:01:51 -03:00
checkout Fix WPCS sniff exclusion 2020-06-12 15:33:28 +02:00
emails Merge pull request #26989 from adamradocz/patch-1 2020-07-24 14:44:05 -03:00
global Bump template versions and fix coding standards 2020-02-04 14:16:07 -03:00
loop Fix total products count display when there's one single result. 2020-07-28 08:47:29 +02:00
myaccount Update template versions for 4.3. 2020-07-04 21:57:39 +02:00
notices Updated templates to handle new notices. 2019-11-07 20:24:37 -03:00
order Fix WPCS sniff exclusion 2020-06-12 15:33:28 +02:00
single-product Merge branch 'fix/26780' of https://github.com/priyankabehera/woocommerce into priyankabehera-fix/26780 2020-07-01 18:01:51 -03:00
archive-product.php WC_Structured_Data::generate_product_data() no more hooked in to woocommerce_shop_loop ,which has been removed in #22912 2019-05-11 20:45:54 +04:30
content-product.php Fix visibility of variable products with layered nav filtering. 2020-07-28 08:55:52 +02:00
content-product_cat.php Fix Squiz.PHP.EmbeddedPhp violations 2019-12-20 15:06:29 -03:00
content-single-product.php Fix wrong hooked function, issue #25996 2020-04-08 07:28:34 +04:30
content-widget-price-filter.php Adding the "translators" comment. 2019-08-02 11:31:11 -03:00
content-widget-product.php Bump template version 2019-01-29 12:19:10 +02:00
content-widget-reviews.php Fix Squiz.PHP.EmbeddedPhp violations 2019-12-20 15:06:29 -03:00
product-searchform.php Removed @author tag from docbloc in the template files 2018-12-06 12:13:39 -02:00
single-product-reviews.php Update template versions for 4.3. 2020-07-04 21:57:39 +02:00
single-product.php Fix Squiz.ControlStructures.ControlSignature violations 2019-12-20 15:09:09 -03:00
taxonomy-product_cat.php Fix WordPress.WhiteSpace.DisallowInlineTabs violations 2019-12-20 14:27:07 -03:00
taxonomy-product_tag.php Fix WordPress.WhiteSpace.DisallowInlineTabs violations 2019-12-20 14:27:07 -03:00