Skip to content

Commit

Permalink
Merge pull request #895 from buckaroo-it/BP-2748-giftcard-grouptransa…
Browse files Browse the repository at this point in the history
…ction-canceled-in-magento

BP-2748 giftcard grouptransaction canceled in magento
  • Loading branch information
LucianTuriacArnia authored Jan 23, 2024
2 parents 66908b3 + fc78328 commit 401503b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 96 deletions.
2 changes: 1 addition & 1 deletion Helper/PaymentGroupTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function getGroupTransactionItems($orderId)
$items = array_values($collection->getItems());

return array_filter($items, function ($item) {
return $item['amount'] - (float)$item['refunded_amount'] > 0;
return (float)$item['amount'] - (float)$item['refunded_amount'] > 0;
});
}

Expand Down
5 changes: 3 additions & 2 deletions Observer/RestoreQuote.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,15 @@ public function execute(Observer $observer): void
) {
$this->logger->addDebug(sprintf(
'[RESTORE_QUOTE] | [Observer] | [%s:%s] - Restore Quote | ' .
'lastRealOrder: %s | previousOrderId: %s',
'lastRealOrder: %s - %s| previousOrderId: %s',
__METHOD__,
__LINE__,
$lastRealOrder->getIncrementId(),
$lastRealOrder->getIncrementId(), $lastRealOrder->getEntityId(),
$previousOrderId
));

$this->checkoutSession->restoreQuote();
$this->checkoutSession->getQuote()->setOrigOrderId(null);
$this->rollbackPartialPayment($lastRealOrder->getIncrementId(), $payment);
$this->setOrderToCancel($previousOrderId);
}
Expand Down
93 changes: 0 additions & 93 deletions Plugin/GiftcardUsageIncrement.php

This file was deleted.

0 comments on commit 401503b

Please sign in to comment.