From 8c9ebd82761904cadc46ccae6d47e28dfbc4e1e4 Mon Sep 17 00:00:00 2001 From: Nathaniel Hammond Date: Thu, 5 Sep 2024 12:59:17 +0100 Subject: [PATCH] Fixed #3544 catalog pricing product conditions potentially not applying --- CHANGELOG.md | 4 ++++ src/models/CatalogPricingRule.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 366562a1ac..290ccd4444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Craft Commerce +## Unreleased + +- Fixed a bug where catalog pricing rules could ignore product conditions. ([#3544](https://github.com/craftcms/commerce/issues/3544)) + ## 5.1.0 - 2024-09-04 ### Store Management diff --git a/src/models/CatalogPricingRule.php b/src/models/CatalogPricingRule.php index 3af4943b7d..547871a641 100644 --- a/src/models/CatalogPricingRule.php +++ b/src/models/CatalogPricingRule.php @@ -259,7 +259,7 @@ public function getPurchasableIds(): ?array $this->_purchasableIds = $productVariantIds; - $variantIds = null; + $variantIds = $productVariantIds; if (!empty($this->getVariantCondition()->getConditionRules())) { $variantQuery = Variant::find(); /** @var CatalogPricingRuleVariantCondition $variantCondition */