Last active
July 13, 2017 14:32
-
-
Save ravixp/38262ed3963f34bd11bf348387c49398 to your computer and use it in GitHub Desktop.
Magento 1: Add the product image on the email order (template/email/order/items/order/default.phtml)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php $_item = $this->getItem() ?> | |
| <?php $_order = $this->getItem()->getOrder() ?> | |
| <?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()); | |
| } ?> | |
| ... | |
| ... | |
| <td class="cell-content product-image" style="padding: 3px 9px; vertical-align: top;"> | |
| <img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(125,125); ?>" width="125" height="125" alt="<?php echo $_item->getName() ?>" style="border: 1px solid #ddd;" /> | |
| </td> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment