下订单后定制订单电子邮件magento

时间:2015-02-25 07:22:12

标签: magento attributes

您好我有一个名为" customer_address"的自定义属性在卖家帐户页面中。

客户下订单后,除了默认SKU价格数量外,此自定义属性必须显示在电子邮件中。

请帮助处理代码和文件位置

1 个答案:

答案 0 :(得分:0)

以下链接可以帮助您。在此源代码中,您可以看到自定义属性在电子邮件中的使用方式。

Add custom attribute in order email templates - Magento

例如 你需要覆盖这个模型:文件[magento] \ app \ code \ core \ Mage \ Sales \ Model \ Order.php

更改此功能:public function sendNewOrderEmail()

$mailer->setTemplateParams(array(
 'order' => $this, 'billing' => $this->getBillingAddress(),
 'payment_html' => $paymentBlockHtml,
 'custom' => $customvariable //your custom variable here )
);

打开此文件[magento] \ app \ locale \ en_US \ template \ email \ sales \ order_new.html

在您想要的电子邮件模板中添加自定义变量。您可以这样添加:{{var custom}}我希望这会对您有所帮助。