Skip to content

Commit

Permalink
Merge pull request #2579 from coreshop/coding-standard/refactor-4.0
Browse files Browse the repository at this point in the history
[CS] Refactor
  • Loading branch information
dpfaffenbauer committed Mar 11, 2024
2 parents f6edde2 + b3e5d2b commit b814c70
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ protected function apply(OrderInterface $cart, PriceRuleItemInterface $cartPrice
$totalDiscountPossible = 0;

$discountableItems = [];

foreach ($cart->getItems() as $item) {
if ($item->getTotal() <= 0) {
continue;
}

$discountableItems[] = $item;
}

if (count($discountableItems) === 0) {
return;
}
}

foreach ($cart->getItems() as $item) {
$totalAmount[] = $item->getTotal(false);
$totalDiscountPossible += $item->getTotal($withTax);
Expand Down Expand Up @@ -213,7 +213,7 @@ protected function apply(OrderInterface $cart, PriceRuleItemInterface $cartPrice
$cartPriceRuleItem->getCartPriceRule()->getName(),
$positive ? $amountGross : (-1 * $amountGross),
$positive ? $amountNet : (-1 * $amountNet),
true
true,
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

namespace CoreShop\Component\Core\Order\Processor;

use CoreShop\Component\Core\Model\OrderItemInterface;
use CoreShop\Component\Order\Model\OrderInterface;
use CoreShop\Component\Order\Processor\CartProcessorInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function applyRule(OrderInterface $cart, array $configuration, PriceRuleI
$cartPriceRuleItem->getCartPriceRule()->getName(),
$cartPriceRuleItem->getDiscount(true),
$cartPriceRuleItem->getDiscount(false),
true
true,
),
);

Expand Down

0 comments on commit b814c70

Please sign in to comment.