我正在尝试在Magento设置发票电子邮件模板,我看到我想要的大部分信息都显示。

但是,我想仅显示商品的名称和购物车摘要的购物车内容。我在每种产品的购物车中添加了某种产品描述,我不希望该部分显示在电子邮件模板中。

我看到购物车在电子邮件模板中显示:

{{layout area="frontend" handle="sales_email_order_invoice_items" invoice=$invoice order=$order}}

有没有一种方法可以显示项目,并且没有每个产品的描述?

有帮助吗?

解决方案

您正朝着正确的方向前进。既然您找到了手柄,请进行一些搜索,您会发现 sales_email_order_invoice_items 句柄在 sales.xml 文件。

<sales_email_order_invoice_items>
    <block type="sales/order_email_invoice_items" name="items" template="email/order/invoice/items.phtml">
        <action method="addItemRender"><type>default</type><block>sales/order_email_items_default</block><template>email/order/items/invoice/default.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/invoice/default.phtml</template></action>
        <block type="sales/order_invoice_totals" name="invoice_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"/>
        </block>
    </block>
    <block type="core/text_list" name="additional.product.info" />
</sales_email_order_invoice_items>
  • email/order/invoice/items.phtml 文件负责发票的主模板。
  • email/order/items/invoice/default.phtml 很可能是您想要的,它将用于每种产品显示其信息。

因此,只需复制 email/order/items/invoice/default.phtml 进入您自己的模板文件夹,然后更改该文件中需要更改的内容。

许可以下: CC-BY-SA归因
scroll top