New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refund for bundle product without receiving product back #23440
Comments
Hi @simonmaass. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @simonmaass do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@magento give me 2.3-develop instance |
Hi @simonmaass. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @simonmaass, here is your Magento instance. |
Hi @engcom-Charlie. Thank you for working on this issue.
|
✅ Confirmed by @engcom-Charlie Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
The root cause of the Problem seems to be in public function createByOrder(\Magento\Sales\Model\Order $order, array $data = [])
{
$totalQty = 0;
$creditmemo = $this->convertor->toCreditmemo($order);
$qtyList = isset($data['qtys']) ? $data['qtys'] : [];
foreach ($order->getAllItems() as $orderItem) {
if (!$this->canRefundItem($orderItem, $qtyList)) {
continue;
}
$item = $this->convertor->itemToCreditmemoItem($orderItem);
$qty = $this->getQtyToRefund($orderItem, $qtyList);
$totalQty += $qty;
$item->setQty($qty);
$creditmemo->addItem($item);
}
$creditmemo->setTotalQty($totalQty);
$this->initData($creditmemo, $data);
$creditmemo->collectTotals();
return $creditmemo;
} Either I have tried fixing it with a check of the qtyList containing an empty array in this scenario (bundle with 0 items refunded). if (!array_key_exists($orderItem->getId(), $qtyList)) {
$qty = 0;
} This works fine except when there is one product of a bundle being refunded. Then the Items are not rendered when viewing the creditmemo. Most likely because the parent product of the bundled item is missing. Additionaly the method |
any update on this? This is rather important for us because we are often refunding money but not taking the product back |
Ping |
Hi @KiuNguyen. Thank you for working on this issue.
|
Hi @simonmaass. Thank you for your report.
The fix will be available with the upcoming 2.4.0 release. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Eventhou the refund was below the mentioned amount!!!
The text was updated successfully, but these errors were encountered: