简体   繁体   English

在Magento 1.9中将​​自定义产品属性添加到交易电子邮件中

[英]Adding custom product attribute to transactional emails in Magento 1.9

I need to print two text attributes below the item ordered in a magento new order template. 我需要在magento新订单模板中订购的商品下方打印两个文本属性。 I've searched and found multiple ways, but they do not seem to work for 1.9 as far as I tried. 我进行了搜索并找到了多种方法,但就我尝试的而言,它们似乎无法在1.9上工作。 Perhaps I'm doing it wrong, but it never seems to be explained clearly. 也许我做错了,但是似乎从来没有清楚地解释过。

Sample code as follows: 示例代码如下:

<tr>
    <td class="order-details">
        <h3>Your order <span class="no-link">#{{var order.increment_id}}</span></h3>
        <p>Placed on {{var order.getCreatedAtFormated('long')}}</p>
    </td>
</tr>
<tr class="order-information">
//preferably custom product attribute prints here
    <td>
        {{if order.getEmailCustomerNote()}}
        <table cellspacing="0" cellpadding="0" class="message-container">
            <tr>
                <td>{{var order.getEmailCustomerNote()}}</td>
            </tr>

I'm new to magento, but I'd like to get this right. 我是magento的新手,但我想做对了。 Could anyone please point me in the right direction to get the two custom product attributes to print in the 1.9 email template? 谁能为我指出正确的方向,以获取要在1.9电子邮件模板中打印的两个自定义产品属性?

//$order =order object
foreach($order->getAllItems() as $item){    
      $product=Mage::getModel('catalog/product')->load($item->getProductId());
      echo  Mage::helper('catalog/image')->init($product, 'small_image')->resize(50,50);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM