【问题标题】:Why is Magento not picking up my theme template file for transactional email order?为什么 Magento 没有为交易电子邮件订单提取我的主题模板文件?
【发布时间】:2011-12-25 19:22:31
【问题描述】:

我在后端对 Magento 的 New Order 交易电子邮件模板进行了一些模板更改。电子邮件顶部的文本更改(在“感谢您的订单...”部分)运行良好。但是,当我更改订单详细信息的模板时,它们并没有出现在我的电子邮件中。

我在模板中创建了两个文件,我认为它们会覆盖电子邮件:

  1. app/design/frontend/default/mythemehere/template/email/order/items.phtml
  2. app/design/frontend/default/mythemehere/template/email/order/items/order/default.phtml

这些在 app/design/frontend/default/mythemehere/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="2" 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>

但是,当我下订单时,我会在电子邮件中收到基本模板。

如果我在 Magento 中提交了覆盖基本模板文件 (app/design/frontend/base/default/template/email/order ...) 的主要罪孽,你瞧,我看到了我的更改!似乎 Magento 非常热衷于使用它的基本模板。

我已经覆盖了销售部分的其他模板(例如:sales/order/view.phtml、sales/order/print.phtml),Magento 论坛上的各种帖子表明我在做正确的事情。可惜!它只是不适合我。

【问题讨论】:

    标签: email templates magento


    【解决方案1】:

    我遇到了同样的问题。我发现电子邮件将在“基本”模板之前使用 /app/design/frontend/default/default 模板。因此,如果您将基本模板复制到默认/默认文件夹中,您的文件将不会在更新时被覆盖。

    但是它仍然不理想,因为它仍然在您的主题文件夹之外,但是它比使用“基本”文件更好。我还没有找到真正的解决方案。

    【讨论】:

      【解决方案2】:

      覆盖base/default 和default/default is strongly discouraged 中的模板,因为更新Magento 会覆盖这些目录。

      对我有用(使用电子邮件)的方法是将修改后的文件放在app/design/frontend/your_design_package/default/templates/ 下。

      【讨论】:

        【解决方案3】:

        将您的自定义主题文件用于订单电子邮件“app/design/frontend/default/mythemehere/template/email/order/items.phtml”

        在后台进入系统->配置->设计

        从左上角选择您的网站 现在在主题模板中取消选中复选框并添加主题名称。

        【讨论】:

          【解决方案4】:

          发生这种情况是因为如果我们在System&gt;Configuration&gt;General -&gt; Design部分下提到错误的值

          我们可以有以下两种情况。

          1) 自定义设计的默认包

          2) 自定义包

          如果我们没有在 Current Package Name 字段下填写正确的值,则会出现问题中提到的问题。

          当我使用 自定义包 时发生了这种情况,但它赋予了价值 当前包名称字段下的默认。

          我们应该正确配置主题,以便 Magento 可以正确遵循主题后备。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2013-11-21
            • 2013-01-14
            • 2015-06-19
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多