woocommerce/includes/abstracts
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
..
abstract-wc-data.php Merge pull request #24066 from malviyaritesh/fix/24062 2020-01-23 14:59:39 +01:00
abstract-wc-deprecated-hooks.php Replaced direct access of many constants with the Constants library 2020-01-31 22:18:47 -08:00
abstract-wc-integration.php Fix Generic.Formatting.MultipleStatementAlignment violations 2019-12-20 14:21:08 -03:00
abstract-wc-log-handler.php Fix PEAR.Functions.FunctionCallSignature violations 2019-12-20 15:25:23 -03:00
abstract-wc-object-query.php PHPCS passing for abstract-wc-object-query.php 2018-03-05 13:39:05 +02:00
abstract-wc-order.php Remove wc_round_tax_total calls because lines would have already been rounded appropriately before reaching here. 2020-07-24 19:12:24 +05:30
abstract-wc-payment-gateway.php Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages 2020-01-28 21:21:29 -08:00
abstract-wc-payment-token.php PHPCS passing for abstract-wc-payment-token.php 2018-03-05 13:54:54 +02:00
abstract-wc-privacy.php Fix Generic.Formatting.MultipleStatementAlignment violations 2019-12-20 14:21:08 -03:00
abstract-wc-product.php Fix visibility of variable products with layered nav filtering. 2020-07-28 08:55:52 +02:00
abstract-wc-session.php PHPCS passing for abstract-wc-session.php 2018-03-05 15:00:52 +02:00
abstract-wc-settings-api.php Update min files and selectWoo 2020-06-16 17:15:12 +02:00
abstract-wc-shipping-method.php Fix WordPress.Arrays.MultipleStatementAlignment errors automatically using phpcbf 2019-12-20 13:51:26 -03:00
abstract-wc-widget.php Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages 2020-01-28 21:21:29 -08:00
class-wc-background-process.php Fix some memory limit values not correctly converting to bytes 2018-10-15 01:26:45 -05:00