getItem(); try { $product = $item->getProductId() ? $this->products->getById((int)$item->getProductId(), false, (int)$item->getStoreId()) : $this->products->get((string)$item->getSku(), false, (int)$item->getStoreId()); $image = (string)($product->getThumbnail() ?: $product->getSmallImage() ?: $product->getImage()); if ($image === '' || $image === 'no_selection') { return ''; } return (string)$this->imageHelper->init($product, 'product_thumbnail_image')->resize(96, 96)->getUrl(); } catch (\Throwable) { return ''; } } }