Skip to main content
Edited the content based on provided url to prevent from the url missing issues
Source Link

Am using Magento 1.8 here i want to send product image in order email. I refer this link Add product image in new order email.

this is the code:

app/design/frontend/base/default/template/email/order/items/order/default.phtml

default.phtml

<?php 

if ($_item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
    $parentId = Mage::getModel('catalog/product_type_configurable')
                       ->getParentIdsByChild($_item->getProductId());  
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($parentId);
} else {
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($_item->getProductId());  
}

?>

And here am showing image

<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
      <img src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getThumbnail()); ?>" width="135" height="135" alt="<?php echo $_item->getName() ?>" />
</td>

But i got mail like this

https://i.sstatic.net/F5bq1.jpgenter image description here

Its not working for simple, configurable and bundle product also

How can i fix this error?

Note: This question already asked but am not get the correct answer.

Am using Magento 1.8 here i want to send product image in order email. I refer this link Add product image in new order email.

this is the code:

app/design/frontend/base/default/template/email/order/items/order/default.phtml

default.phtml

<?php 

if ($_item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
    $parentId = Mage::getModel('catalog/product_type_configurable')
                       ->getParentIdsByChild($_item->getProductId());  
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($parentId);
} else {
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($_item->getProductId());  
}

?>

And here am showing image

<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
      <img src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getThumbnail()); ?>" width="135" height="135" alt="<?php echo $_item->getName() ?>" />
</td>

But i got mail like this

https://i.sstatic.net/F5bq1.jpg

Its not working for simple, configurable and bundle product also

How can i fix this error?

Note: This question already asked but am not get the correct answer.

Am using Magento 1.8 here i want to send product image in order email. I refer this link Add product image in new order email.

this is the code:

app/design/frontend/base/default/template/email/order/items/order/default.phtml

default.phtml

<?php 

if ($_item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
    $parentId = Mage::getModel('catalog/product_type_configurable')
                       ->getParentIdsByChild($_item->getProductId());  
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($parentId);
} else {
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($_item->getProductId());  
}

?>

And here am showing image

<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
      <img src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getThumbnail()); ?>" width="135" height="135" alt="<?php echo $_item->getName() ?>" />
</td>

But i got mail like this

enter image description here

Its not working for simple, configurable and bundle product also

How can i fix this error?

Note: This question already asked but am not get the correct answer.

Source Link
Madhumitha
  • 329
  • 1
  • 13

Magento 1.8 Order mail product image not appear

Am using Magento 1.8 here i want to send product image in order email. I refer this link Add product image in new order email.

this is the code:

app/design/frontend/base/default/template/email/order/items/order/default.phtml

default.phtml

<?php 

if ($_item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
    $parentId = Mage::getModel('catalog/product_type_configurable')
                       ->getParentIdsByChild($_item->getProductId());  
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($parentId);
} else {
    $_product = Mage::getModel('catalog/product')  
                       ->setStoreId($_item->getOrder()->getStoreId())  
                       ->load($_item->getProductId());  
}

?>

And here am showing image

<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
      <img src="<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_product->getThumbnail()); ?>" width="135" height="135" alt="<?php echo $_item->getName() ?>" />
</td>

But i got mail like this

https://i.sstatic.net/F5bq1.jpg

Its not working for simple, configurable and bundle product also

How can i fix this error?

Note: This question already asked but am not get the correct answer.