Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email 向订单电子邮件添加非数据库属性_Email_Magento_Attributes - Fatal编程技术网

Email 向订单电子邮件添加非数据库属性

Email 向订单电子邮件添加非数据库属性,email,magento,attributes,Email,Magento,Attributes,我们有一个单一的属性,显示在单一产品页面上。属性名为lieferkW。对于产品的任何订单,我希望在订单电子邮件中将此属性的内容发送给我们的客户 我不想在数据库中保存此属性的内容。您有解决我问题的方法吗?您可以使用其他资源,如会话、本地存储或临时文件 但是,我建议您将其存储在数据库中,并在发送电子邮件时将其删除。你可以有一张这样的桌子 temporary_attributes(id, userId, attribute, orderId) 在需要时插入它,并在发送电子邮件后将其删除。要在销售订单

我们有一个单一的属性,显示在单一产品页面上。属性名为lieferkW。对于产品的任何订单,我希望在订单电子邮件中将此属性的内容发送给我们的客户


我不想在数据库中保存此属性的内容。您有解决我问题的方法吗?

您可以使用其他资源,如会话、本地存储或临时文件

但是,我建议您将其存储在数据库中,并在发送电子邮件时将其删除。你可以有一张这样的桌子

temporary_attributes(id, userId, attribute, orderId)

在需要时插入它,并在发送电子邮件后将其删除。

要在销售订单电子邮件中包含自定义属性
lieferkW
,请进行以下更改

1) 打开
\app\code\core\Mage\Sales\Model\Order.php

$customAttr = 'custom_value'; // the attribute "lieferkW" value
$mailer->setTemplateParams(array(
          'order'        => $this,
          'billing'      => $this->getBillingAddress(),
          'payment_html' => $paymentBlockHtml,
          'custom'       => $customAttr //your custom value here
      )
);
2) 现在更改位于
\app\locale\en\u US\template\email\sales\order\u new.html的电子邮件模板

您可以在此处访问变量,如

{{var custom}}
我建议不要对核心文件进行更改