我对 Magento 的 做了一些模板更改新订单 后端的交易电子邮件模板。电子邮件顶部的文本更改(在“感谢您的订单...”部分)工作正常。但是当我更改订单详细信息的模板时,它们没有出现在我的电子邮件中。
我在我的模板中创建了两个文件,我认为它们会覆盖电子邮件:
app/design/frontend/default/mythemehere/template/email/order/items.phtml
app/design/frontend/default/mythemehere/template/email/order/items/order/default.phtml
这些在
app/design/frontend/default/mythemehere/layout
中的我的 sales.xml 文件中被引用。<sales_email_order_items>
<block type="sales/order_email_items" name="items" template="email/order/items.phtml">
<action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default.phtml</template></action>
<block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
<action method="setLabelProperties"><value>colspan="2" 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>
</block>
<block type="core/text_list" name="additional.product.info" />
</sales_email_order_items>
但是,当我下订单时,我会在电子邮件中收到基本模板。
如果我在 Magento 中提交了覆盖基本模板文件(
app/design/frontend/base/default/template/email/order ...
)的主要罪过,瞧,我看到了我的更改!似乎 Magento 非常热衷于使用其基本模板。我已经覆盖了销售部分的其他模板(例如:
sales/order/view.phtml
、 sales/order/print.phtml
),并且 Magento 论坛上的各种帖子表明我在做正确的事情。可惜!它只是不适合我。
最佳答案
将您的自定义主题文件用于订单电子邮件“app/design/frontend/default/mythemehere/template/email/order/items.phtml”
在管理员中转到 System->configuration->design
从左上角选择您的网站
现在在主题模板中取消选中复选框并添加主题名称。
关于email - 为什么 Magento 没有为交易电子邮件订单提取我的主题模板文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8073832/