Skip to content

Commit f8bcd6c

Browse files
committed
ACP2E-4157: Error when create credit memo for offline refund
1 parent ef2b8bd commit f8bcd6c

File tree

1 file changed

+4
-3
lines changed
  • app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo

1 file changed

+4
-3
lines changed

app/code/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/Save.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Sales\Model\Order\Email\Sender\CreditmemoSender;
1313
use Magento\Catalog\Model\Product\Type\AbstractType;
1414
use Magento\Sales\Model\Order\Creditmemo\Item;
15+
use Magento\Catalog\Model\Product\Type;
1516

1617
/**
1718
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -181,19 +182,19 @@ private function adjustCreditMemoItemQuantities(Creditmemo $creditMemo): void
181182
}
182183

183184
/**
184-
* Check if quantity accumulation should be skipped for bundle products with fixed pricing
185+
* Check if the quantity adjustment should be skipped
185186
*
186187
* @param Item $item
187188
* @return bool
188189
*/
189190
private function shouldSkipQuantityAccumulation(Item $item): bool
190191
{
191192
$parentOrderItem = $item->getOrderItem()->getParentItem();
192-
if (!$parentOrderItem || $parentOrderItem->getProductType() !== 'bundle') {
193+
if (!$parentOrderItem || $parentOrderItem->getProductType() !== Type::TYPE_BUNDLE) {
193194
return false;
194195
}
195196
$parentOptions = $parentOrderItem->getProductOptions();
196197
return isset($parentOptions['product_calculations']) &&
197-
$parentOptions['product_calculations'] == AbstractType::CALCULATE_PARENT;
198+
$parentOptions['product_calculations'] === AbstractType::CALCULATE_PARENT;
198199
}
199200
}

0 commit comments

Comments
 (0)