Skip to content

Commit 16bcb7d

Browse files
committed
fix order credit memo
1 parent d9a5e56 commit 16bcb7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Observer/Order/CreditmemoAfterSave.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function executeWhenEnabled(\Magento\Framework\Event\Observer $observer)
7171
*/
7272
protected function refundDiff($order)
7373
{
74-
$oldData = $this->registry->registry(self::REGISTRY_KEY_ORDER_OLD_DATA);
75-
$oldValue = $this->connectHelper->priceAsCents($oldData['total_refunded']);
74+
$oldData = $this->registry->registry(self::REGISTRY_KEY_ORDER_OLD_DATA) ?? [];
75+
$oldValue = isset($oldData['total_refunded']) ? $this->connectHelper->priceAsCents($oldData['total_refunded']) : 0;
7676
$newValue = $this->connectHelper->priceAsCents($order->getTotalRefunded());
7777

7878
return ($newValue - $oldValue);

0 commit comments

Comments
 (0)