I have tried below 2 solutions:
I am using Claue theme, I pasted the below code in invoice/default.phtml & order/default.phtml, then did a setup:static-content:deploy -f
. Created new Order, but I do not see the product image in email only the items as shown in the image below.
PATH:
app/design/frontend/Mgs/claue/Magento_Bundle/templates/email/order/items/order
CODE:
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product_id = $_item->getProductId();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load($product_id);
$_imagehelper = $objectManager->get('Magento\Catalog\Helper\Image');
$image_url = $_imagehelper->init($product, 'cart_page_product_thumbnail')->getUrl();
?>
<img src="<?php echo $image_url ; ?>" alt="<?php echo $product->getName(); ?>" />
This is what I see in email:
I am using Magento 2.3.5-p1, I am not sure if I am pasting the code in correct block. I pasted it below <tr class="bundle-item bundle-parent">
and above <td class="item-info">
.