I'm working on a module that changes the Checkout Order Summary Image to an external image url.
public function afterGetImages(ImageProvider $subject, array $result): array
{
foreach ($result as $itemId => $value) {
/** @var \Magento\Quote\Model\Quote\Item $item **/
$item = $this->itemFactory->create()->load($itemId);
if ($item) {
$productid = $item->getProduct();
$result = $item['product_image']['src'] = "https://static.integromat.com/img/packages/magento_256.png";
}
}
return $result;
}
I get the error:
Notice: Indirect modification of overloaded element of Magento\Sales\Model\Order\Item\Interceptor has no effect on line 26
Which is this line:
$result = $item['product_image']['src'] = "https://static.integromat.com/img/packages/magento_256.png";
What am I doing wrong?
How can an image on the Checkout Order Summary changed?
Thank you.