简体   繁体   English

Magento隐藏/删除交易电子邮件中的价格

[英]Magento hide / remove prices from transactional emails

  • I am trying to hide / remove prices from within magento transactional emails. 我正在尝试隐藏/删除magento交易电子邮件中的价格。

    • I have been able to hide the prices from the everywhere else in the 我已经能够在其他地方隐藏价格
      cart via css but not the emails. 通过css而不是电子邮件发送购物车。

    • I have tried commenting out the code that renders the price but it 我试图注释掉呈现价格的代码,但它
      seems mag needs this code to send the emails. 似乎mag需要此代码来发送电子邮件。

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks 谢谢

The default .phtml files for the order emails that display prices are saved in 显示价格的订单电子邮件的默认.phtml文件保存在

app/design/frontend/default/base/template/email/order/items/

and

app/design/adminhtml/default/default/template/email/order/items.phtml    

To remove prices from these emails, look through them for references to the function formatPrice and remove the surrounding HTML. 要从这些电子邮件中删除价格,请在它们中查找功能formatPrice引用,并删除周围的HTML。 If you remove the entire "Subtotal" <td> , then you'll want to also remove the "Subtotal" heading <th> from 如果您删除整个“小计” <td> ,那么您也将希望从中删除“小计”标题<th>

app/design/frontend/default/base/template/email/order/items.phtml

Ideally you should avoid modifying the original files and would instead copy the files to your own theme folder and make your changes to the copy. 理想情况下,您应该避免修改原始文件,而应将文件复制到您自己的主题文件夹,然后对副本进行更改。

Not a good idea, this might take out all the information below the product rows plus you may find any products other than the first one missing. 这不是一个好主意,这可能会删除产品行下方的所有信息,此外,您可能会发现除第一个缺失的产品以外的任何产品。

If you just want to hide the totals, edit your local.xml file by adding this: 如果只想隐藏总计,请添加以下内容来编辑local.xml文件:

<sales_email_order_items>
<remove name="order_totals" />
</sales_email_order_items>

This will remove the information from your order emails and leave the info there for invoices etc. 这将从您的订单电子邮件中删除信息,并将其保留在发票等中。

OR if using 1.9 then probably best to edit etc/theme.xml but I am not sure what you would need to do there. 或者,如果使用1.9,则最好编辑etc / theme.xml,但是我不确定在那里需要做什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM