Magento从订单电子邮件中删除SKU
在我的新订单电子邮件中,我有产品的SKU,但我想从订单电子邮件中删除它。我该怎么做呢?这其实是个好问题。谢谢你问帕特里克 无法从管理界面执行此操作,因为包含订单项的块已插入模板中。如果您查看Magento从订单电子邮件中删除SKU,magento,Magento,在我的新订单电子邮件中,我有产品的SKU,但我想从订单电子邮件中删除它。我该怎么做呢?这其实是个好问题。谢谢你问帕特里克 无法从管理界面执行此操作,因为包含订单项的块已插入模板中。如果您查看app/locale/en_US/template/email/sales/order_new.html,您将看到以下代码,这些代码将在渲染期间替换为ordered items块: {{layout handle="sales_email_order_items" order=$order}} 如您所见,该
app/locale/en_US/template/email/sales/order_new.html
,您将看到以下代码,这些代码将在渲染期间替换为ordered items块:
{{layout handle="sales_email_order_items" order=$order}}
如您所见,该块的句柄是sales\u email\u order\u items
,其声明可在app/design/frontend/base/default/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="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>
</block>
<block type="core/text_list" name="additional.product.info" />
</sales_email_order_items>
第二个渲染表体的行。在这里,您必须删除第64行:
<td><?php echo $this->htmlEscape(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>
您不需要将布局xml复制到主题中。只有那两个模板文件
不幸的是,它还将从客户帐户的订单视图中删除SKU列,因为这些模板也在那里使用。因此,如果只想从电子邮件中删除SKU列,则必须在主题的
local.xml
文件中创建一个新句柄,该句柄与sales.xml
中的句柄相同。然后,您必须在Magento admin创建电子邮件模板的自定义副本,并将新句柄放入{{layout}
快捷码中。当然,这两个模板也需要使用不同的名称进行复制。我看到它不在那里。您可以通过将电子邮件模板中的布局句柄更改为您自己的自定义句柄来防止客户的帐户部分受到影响,该自定义句柄改为调用您自己的模板,将原件原封不动地保留在其他需要的地方。
<td><?php echo $this->htmlEscape(Mage::helper('core/string')->splitInjection($this->getSku())) ?></td>