我对magento完全陌生&使用版本1.7。当客户下订单时,我想删除订单电子邮件中的sku号码。经过大量的研发,我注意到,使用的模板是来自app/design/frontend/base/default/template/email/order/items.phtml和产品名称,sku号码,数量和价格来自echo $this->getItemHtml($_item)这条线。我不太清楚,我应该如何从这一行删除sku数字列?还是有其他方法可以这样做?
任何帮助都很感激。谢谢。
发布于 2014-01-21 14:36:02
让我来解释一下你们的过程。
您可以在app/locale/en_US/template/email/sales/order_new.html.找到订单电子邮件模板。在这个文件中,您可以在第97号线找到这一行{{layout handle="sales_email_order_items" order=$order}}。
在这里,您可以看到句柄是"sales_email_order_items“,您可以在app\design\frontend\base\default\layout\sales.xml第268号行中找到这个块。
<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" />
在这个块中,您可以看到文件路径"email/order/items.phtml (app\design\frontend\base\default\template\email\order\items.phtml)“”
在此文件中,只需在第33行注释此代码<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>即可。
现在,在上面的块上,您可以看到另一个文件路径'email\order\items\order\default.phtml(app\design\frontend\base\default\template\email\order\items\order\default.phtml)‘
在这个文件中,只需在第48行注释这段代码<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"><?php echo $this->htmlEscape($this->getSku($_item)) ?></td>。
好了。
发布于 2020-01-10 12:20:01
在Magento2.3中,"sales_email_order_renderers.xml“呈现phtml.file,它为订单电子邮件中的项目定义内容。
要删除SKU,可以执行以下步骤:
- Remove the SKU from the default.phtml
- clear cache (php bin/magento cache:flush)
https://stackoverflow.com/questions/21259508
复制相似问题