Duplicated line on invoice/order for configurable product
When configurable product is ordered, Magento show 2 lines in order (and in invoice)
configurable product generates 2 lines : one with the actual price and the other one with $0 price.
Go this location:
app/code/Ess/M2ePro/Plugin/Order/Magento/Quote/Model/Quote/Item/
Replace 2 function :
public function aroundConvert($interceptor, \Closure $callback, $item)
{
return $this->execute('convert', $interceptor, $callback, [$item]);
}
// ---------------------------------------
protected function processConvert($interceptor, \Closure $callback, $arguments)
{
$orderItem = $callback($arguments[0]);
$this->eventManager->dispatch(
'ess_sales_convert_quote_item_to_order_item',
[
'order_item' => $orderItem,
'item' => $arguments[0],
]
);
return $orderItem;
}
To:
public function aroundConvert($interceptor, \Closure $callback, ...$arguments)
{
return $this->execute('convert', $interceptor, $callback, $arguments);
}
// ---------------------------------------
protected function processConvert($interceptor, \Closure $callback, $arguments)
{
$orderItem = $callback(...$arguments);
$this->eventManager->dispatch(
'ess_sales_convert_quote_item_to_order_item',
[
'order_item' => $orderItem,
'item' => $arguments[0],
]
);
return $orderItem;
}
When configurable product is ordered, Magento show 2 lines in order (and in invoice)
configurable product generates 2 lines : one with the actual price and the other one with $0 price.
Go this location:
app/code/Ess/M2ePro/Plugin/Order/Magento/Quote/Model/Quote/Item/
Replace 2 function :
public function aroundConvert($interceptor, \Closure $callback, $item)
{
return $this->execute('convert', $interceptor, $callback, [$item]);
}
// ---------------------------------------
protected function processConvert($interceptor, \Closure $callback, $arguments)
{
$orderItem = $callback($arguments[0]);
$this->eventManager->dispatch(
'ess_sales_convert_quote_item_to_order_item',
[
'order_item' => $orderItem,
'item' => $arguments[0],
]
);
return $orderItem;
}
To:
public function aroundConvert($interceptor, \Closure $callback, ...$arguments)
{
return $this->execute('convert', $interceptor, $callback, $arguments);
}
// ---------------------------------------
protected function processConvert($interceptor, \Closure $callback, $arguments)
{
$orderItem = $callback(...$arguments);
$this->eventManager->dispatch(
'ess_sales_convert_quote_item_to_order_item',
[
'order_item' => $orderItem,
'item' => $arguments[0],
]
);
return $orderItem;
}
No comments:
Post a Comment