Skip to content

Commit

Permalink
Merge pull request #2289 from dpfaffenbauer/issue/voucher
Browse files Browse the repository at this point in the history
[Order] fix voucher modifier calling findByCode with null
  • Loading branch information
dpfaffenbauer committed May 22, 2023
2 parents b945183 + 1ca6914 commit 9b69077
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CoreShop/Component/Order/Modifier/VoucherModifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public function decrement(OrderInterface $order): void
continue;
}

if (!$item->getVoucherCode()) {
continue;
}

$voucherCode = $this->voucherCodeRepository->findByCode($item->getVoucherCode());
if ($voucherCode instanceof CartPriceRuleVoucherCodeInterface) {
if ($voucherCode->getUses() !== 0) {
Expand Down

0 comments on commit 9b69077

Please sign in to comment.