I've been working on a module to change Magento Thumbnails in the Cart, Minicart and Checkout Order Summary. The only place I cannot get this to work is the Checkout Order Summary. There is a real lack of documentation on how to modify the image thumbnails there.
So far, I have:
<?php
namespace Configurable\Products\Plugin;
use Magento\Checkout\Model\Cart\ImageProvider;
use Magento\Catalog\Block\Product\AbstractProduct;
use Magento\Quote\Model\Quote\ItemFactory;
use Magento\Checkout\Model\Session as CheckoutSession;
use Magento\Checkout\CustomerData\DefaultItem;
class afterGetImages
{
 protected $itemFactory;
 public function __construct(
 \Magento\Sales\Model\Order\ItemFactory $itemFactory,
 ) {
 $this->itemFactory = $itemFactory;
 }
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();
 }
 }
 }
}
But this returns:
Return value must be of type array, none returned on line 31
It does not seem to be fetching the data correctly.
Secondly, I can find no information of what argument to modify to change the Order Summary Checkout Image. Looking at magento/module-checkout/Model/Cart/ImageProvider.php, it includes:
$imageData = [
 'src' => $imageHelper->getUrl(),
 'alt' => $imageHelper->getLabel(),
 'width' => $imageHelper->getWidth(),
 'height' => $imageHelper->getHeight(),
];
return $imageData;
But including this logic in my function:
$imageData = [
 'src' => "Image Url",
 ];
 return $imageData;
Does not change the image. I've spend many days on this but I keep hitting a brick wall. What needs to be changed here to modify the Checkout Order Summary Thumbnails? I found this thread but it didn't seem to change Order Summary Thumbnails for me.
Thank you.
- 
 Trying also, $item->setImageUrl("static.integromat.com/img/packages/magento_256.png"); But no luck with that.Chris Oliver– Chris Oliver2023年11月07日 16:04:07 +00:00Commented Nov 7, 2023 at 16:04
- 
 I believe this is correct: $result = $item['product_image']['src'] = "static.integromat.com/img/packages/magento_256.png" But it gives error Notice: Indirect modification of overloaded elementChris Oliver– Chris Oliver2023年11月07日 17:12:50 +00:00Commented Nov 7, 2023 at 17:12
- 
 Any luck my friend. I am also having same problemAvesh Naik– Avesh Naik2024年06月24日 16:37:21 +00:00Commented Jun 24, 2024 at 16:37