php 编辑 Magento 订单确认电子邮件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21893455/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Editing Magento order confirmation email
提问by Kender
I am looking to edit the block of the email that contains the order totals (shipping, grand total), but cant find the template file for this bit of code
我想编辑包含订单总额(运输、总计)的电子邮件块,但找不到这段代码的模板文件
I need to remove shipping and grand total lines, only showing subtotal lines
我需要删除运费和总计行,只显示小计行
I have checked the template via System > Transnational Emails Looked at a large group of phtml files trying to find this specific instance (will be for both registered and unregistered users if this makes a difference)
我已经通过系统 > 跨国电子邮件检查了模板查看了一大组 phtml 文件试图找到这个特定的实例(如果这有所不同,将适用于注册和未注册用户)
currently the email is formatted as:
目前电子邮件的格式为:
[logo]
hello {name/guest}
thank you message, {email} {tel}
order id info and date
billing info / payment method
shipping info / shipping method
order details - assuming this is {{layout handle="sales_email_order_items" order=$order}}
thank you message
on the order details line its a table
在订单详情行是一张桌子
line item for each: item, sku, qty, subtotal
每个行项目:项目、sku、数量、小计
after all of the items is subtotal, then next line is shipping, then next line is total - it is 2 of those lines i want to get rid of, shipping and either subtotal or total
在所有项目小计之后,下一行是运输,然后下一行是总计 - 这是我想要摆脱的 2 行,运输和小计或总计
采纳答案by Kamal Joshi
In sales.xml layout, there is sales_email_order_items which is responsible for order items and contains
在 sales.xml 布局中,有 sales_email_order_items 负责订单项目并包含
<block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
<action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
<action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
<block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
<action method="setIsPlaneMode"><value>1</value></action>
</block>
</block>
Try to assign new template instead of sales/order/totals.phtml in order_totals and modify that new template to display only totals. I have not tested but this can give you direction.
尝试在 order_totals 中分配新模板而不是 sales/order/totals.phtml 并修改该新模板以仅显示总计。我没有测试过,但这可以给你方向。
回答by lavb
The default emails are located on
默认电子邮件位于
/app/locale/en_US/template/email/
Thanks
谢谢

![php SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: 没有这样的主机是已知的。PHP错误](/res/img/loading.gif)