【问题标题】:get custom configuration into email template (Magento)将自定义配置放入电子邮件模板(Magento)
【发布时间】:2016-03-30 05:20:34
【问题描述】:

嘿嘿。我的解释不太好,但我会尝试的。 如何从 magento 中的配置中获取数据到电子邮件模板。例如,我已经在商店信息上添加了新字段:

配置 > 常规 > 商店信息

我添加的字段是gst no,代码如下。

system.xml

<fields>
                    <gst_no>
                        <label>GST No</label>
                        <frontend_type>text</frontend_type>
                        <sort_order>31</sort_order>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>                    
                    </gst_no>
</fields>

它按预期运行。现在我如何在电子邮件模板上调用这个值。比如

{{var store_email}}

换句话说,数据是作为变量工作的。 或者如果有办法将 GST 字段设置为全局变量,如电子邮件、联系电话等。我已经尝试过 {{config path="general/store_information/gst_no"}} 但不起作用。在 php 级别上它会像这样工作Mage::getStoreConfig('general/store_information/gst_no');

提前感谢:)

【问题讨论】:

  • 怎么样?抱歉我的解释不好。我的意思是,将自定义数据从配置调用到电子邮件。

标签: php email magento


【解决方案1】:

你走对了。

在您的电子邮件模板中添加 {{config path="general/store_information/gst_no"}}

现在登录到管理面板并导航到系统->权限->变量

点击添加新变量并用general/store_information/gst_no填充文本框。将允许设置为

希望对您有所帮助!

【讨论】:

  • 感谢 makwana,它的工作。哈哈 :) 我想问一点。在这种情况下,我们需要创建添加权限吗?如何仅将 general/store_information/gst_no 设置为 gst_no。我的意思是像调用像 {{var store_email}} 这样的全局变量。 {{config path="general/store_information/gst_no"}}{{var store_gst_no}}
猜你喜欢
  • 1970-01-01
  • 2014-02-10
  • 2014-03-23
  • 1970-01-01
  • 2011-04-10
  • 2020-02-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多