【发布时间】:2015-10-21 17:25:21
【问题描述】:
我使用 Opencart 2.0 为我的注册/结帐表单创建了自定义字段。它们显示在每个订单下的管理部分,我已成功将它们添加到order_invoice.tpl,但我需要将它们添加到发送给客户的确认电子邮件中。我想我找到了正确的控制器文件:catalog>controller>account>order.tpl 但我认为问题是用于在order_invoice.tpl 中打印出来的代码引用了管理端的文件夹或文件。
这是我试图在 catalog>view>theme>yourtheme>template>mail>order.tpl 中执行的代码
<?php foreach ($account_custom_fields as $custom_field) { ?>
<strong><?php echo $custom_field['name']; ?></strong>:
<?php echo $custom_field['value']; ?><br />
<?php } ?>
这是我得到的错误:
注意:未定义变量:account_custom_fields in /home/raphaelseventworks.com/www/ncbaorders/catalog/view/theme/journal2/template/mail/order.tpl 在第 70 行警告:为 foreach() 提供的参数无效 /home/raphaelseventworks.com/www/ncbaorders/catalog/view/theme/journal2/template/mail/order.tpl 在第 70 行
有人知道如何在订单确认电子邮件中打印自定义字段吗?或者我需要在catalog>controller>account>order.tpl 中添加什么代码才能完成这项工作?
谢谢!
【问题讨论】:
标签: opencart opencart2.x