首先打开: app\design\adminhtml\default\default\template\sales\order\view\items.phtml找到大概45行处的以下代码:<th><spanclass="nobr"><?phpecho $this->helper('sales')->__('Item Status') ?></span></th>
在这之上插入如下代码:<th><span><?phpecho $this->helper('sales')->__('Product Image') ?></span></th>再打开:app\design\adminhtml\default\default\template\sales\order\view\items\renderer\default.phtml 找到大概41行处代码:<td class="a-center"><?php echo $_item->getStatus() ?></td>在这之上插入下列代码:<td>
<?php
$item_id = $_item->getProductId();
$item_imgurl = Mage::getBaseUrl('media').'catalog/product'.Mage::getModel('catalog/product')->load($item_id)->getImage();
?>
<a target="_blank" href="<?php echo $item_imgurl; ?>"><img height="80" width="80" alt="" src="<?php echo $item_imgurl; ?>"></a>
</td>
本文指导如何在Magento订单查看项模板中添加产品图片显示功能,通过在指定位置插入代码来实现。
6823

被折叠的 条评论
为什么被折叠?



