Skip to main content
Tweeted twitter.com/StackMagento/status/845489451962957824
added 1037 characters in body
Source Link
Ramesh S
  • 1.2k
  • 10
  • 36

The new order email template is rendering everything except the product image of the order.

This is how the template was trying to call it by default, which doesn't work:

{{layout handle="sales_email_order_items" order=$order}}

This is the error:

enter image description here

Can anyone advise on what might be the problem.

This is the function i worte:

app/design/frontend/base/default/template/email/order/items/order/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());  
}

?>

this is display code:

<img src="<?php echo Mage::getModel('catalog/product_media_config')  
                        ->getMediaUrl($_product->getThumbnail()); ?>"  width="135" height="135" alt="<?php echo $_item->getName() ?>" />  

The new order email template is rendering everything except the product image of the order.

This is how the template was trying to call it by default, which doesn't work:

{{layout handle="sales_email_order_items" order=$order}}

This is the error:

enter image description here

Can anyone advise on what might be the problem.

The new order email template is rendering everything except the product image of the order.

This is how the template was trying to call it by default, which doesn't work:

{{layout handle="sales_email_order_items" order=$order}}

This is the error:

enter image description here

Can anyone advise on what might be the problem.

This is the function i worte:

app/design/frontend/base/default/template/email/order/items/order/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());  
}

?>

this is display code:

<img src="<?php echo Mage::getModel('catalog/product_media_config')  
                        ->getMediaUrl($_product->getThumbnail()); ?>"  width="135" height="135" alt="<?php echo $_item->getName() ?>" />  
Source Link
Ramesh S
  • 1.2k
  • 10
  • 36

New order email missing product image {{layout handle="sales_email_order_items" order=$order}}

The new order email template is rendering everything except the product image of the order.

This is how the template was trying to call it by default, which doesn't work:

{{layout handle="sales_email_order_items" order=$order}}

This is the error:

enter image description here

Can anyone advise on what might be the problem.