Skip to content

Commit

Permalink
Also apply for VariantQuery::hasProduct
Browse files Browse the repository at this point in the history
  • Loading branch information
boboldehampsink authored Nov 7, 2023
1 parent f7d4dcf commit a18d57b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/elements/db/VariantQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -927,11 +927,11 @@ private function _applyHasProductParam(): void

$productQuery->limit = null;
$productQuery->select('commerce_products.id');
$productIds = $productQuery->column();

// Remove any blank product IDs (if any)
$productIds = array_filter($productIds);
$this->subQuery->andWhere(['commerce_variants.productId' => $productIds]);
$productQuery->andWhere(['not', ['commerce_products.id' => null]]);

$this->subQuery->andWhere(['commerce_variants.productId' => $productQuery]);
}

/**
Expand Down

0 comments on commit a18d57b

Please sign in to comment.