Skip to content

Commit fad2b6f

Browse files
committed
Extra safety
1 parent f06d561 commit fad2b6f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Models/Product.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,8 @@ public function getUnitPrice(int $quantity = 1, int $customerGroup = 0)
242242
// NOTE: We always need the option with the lowest matching value, *not* the one with the highest matching qty!
243243
// It wouldn't make sense to select a tier with a higher qty if the price is higher.
244244

245-
$prices = [$tierPrice, $this->price, $this->specialPrice];
246-
247-
return min(Arr::whereNotNull($prices));
245+
$prices = Arr::whereNotNull([$tierPrice, $this->price, $this->specialPrice]);
246+
return $prices ? min($prices) : null;
248247
}
249248

250249
public function getPrice(int $quantity = 1, int $customerGroup = 0)

0 commit comments

Comments
 (0)