From 39519234d1564123fa91ff39c7e349b9fce5bc68 Mon Sep 17 00:00:00 2001 From: Andrea De Luca Date: Thu, 23 Jan 2025 22:51:37 +0100 Subject: [PATCH] fix: use correct base price in PricingResponse Base price shouldn't be customerGroup scoped, so use $basePrice where customer_group_id is false. --- packages/core/src/Managers/PricingManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/Managers/PricingManager.php b/packages/core/src/Managers/PricingManager.php index b6e06cacec..ce2927840a 100644 --- a/packages/core/src/Managers/PricingManager.php +++ b/packages/core/src/Managers/PricingManager.php @@ -217,7 +217,7 @@ public function get() $this->pricing = new PricingResponse( matched: $matched, - base: $prices->first(fn ($price) => $price->tier == 1), + base: $basePrice, tiered: $prices->filter(fn ($price) => $price->tier > 1), customerGroupPrices: $prices->filter(fn ($price) => (bool) $price->customer_group_id) );