首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从订单电子邮件中删除sku号码- magento

从订单电子邮件中删除sku号码- magento
EN

Stack Overflow用户
提问于 2014-01-21 13:26:25
回答 2查看 3.2K关注 0票数 0

我对magento完全陌生&使用版本1.7。当客户下订单时,我想删除订单电子邮件中的sku号码。经过大量的研发,我注意到,使用的模板是来自app/design/frontend/base/default/template/email/order/items.phtml和产品名称,sku号码,数量和价格来自echo $this->getItemHtml($_item)这条线。我不太清楚,我应该如何从这一行删除sku数字列?还是有其他方法可以这样做?

任何帮助都很感激。谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 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号行中找到这个块。

代码语言:javascript
复制
<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>

好了。

票数 2
EN

Stack Overflow用户

发布于 2020-01-10 12:20:01

在Magento2.3中,"sales_email_order_renderers.xml“呈现phtml.file,它为订单电子邮件中的项目定义内容。

要删除SKU,可以执行以下步骤:

  • 创建模块(例如公司/示例)
  • 将/vendor/magento/module-sales/view/frontend/layout/中的"sales_email_order_renders.xml“复制到/app/code/COMPANY/SAMPLE/view/frontend/layout/
  • 将/vendor/magento/module-sales/view/frontend/templates/email/items/order/中的"default.phtml“复制到/app/code/COMPANY/SAMPLE/view/frontend/templates/email/items/order/
  • 更新模块中的"sales_email_order_renders.xml“以呈现模块中的"default.phtml”(参见下面的示例)

代码语言:javascript
复制
- Remove the SKU from the default.phtml 
- clear cache (php bin/magento cache:flush)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21259508

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档