This is the blog for getting Idea regarding PHP, Magento, jQuery and JavaScript for Customization.

Thursday, 16 April 2015

Magento : Display product image in order transaction mail


Hi, Some Time client want some extra, just like here,
For set Product image with the mails in Magento you need to follow just 2 change for that
1) File for Edit : app/design/frontend/base/default/template/email/order/items.phtml
   After the below mentioned line
  <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
  Add this,
  <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Image') ?></th>

2) File for Edit : 
app/design/frontend/base/default/template/email/order/items/order/default.phtml

   After the below mentioned line
  
<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"><?php echo $this->escapeHtml($this->getSku($_item)) ?></td>


  Add this,
        <td align="center" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
                  <img src="<?php echo $this->helper('catalog/image')->init(Mage::getModel('catalog/product')->load($_item->getProductId()), 'small_image')->resize(135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" />
      </td>

Now, Go to admin and Clear Cache, Make Order you got the Product image also with order !

No comments:

Post a Comment