diff --git a/Model/GiftRuleService.php b/Model/GiftRuleService.php index e566013..8d6818c 100644 --- a/Model/GiftRuleService.php +++ b/Model/GiftRuleService.php @@ -121,7 +121,7 @@ public function getAvailableGifts(Quote $quote) if (isset($quoteItems[$giftRuleId])) { $gifts[$giftRuleId][GiftRuleDataInterface::QUOTE_ITEMS] = $quoteItems[$giftRuleId]; $gifts[$giftRuleId][GiftRuleDataInterface::REST_NUMBER] - -= count($gifts[$giftRuleId][GiftRuleDataInterface::QUOTE_ITEMS]); + -= array_sum($gifts[$giftRuleId][GiftRuleDataInterface::QUOTE_ITEMS]); } /** @var GiftRuleDataInterface $giftRuleData */ $giftRuleData = $this->giftRuleDataFactory->create();