Php 将自定义配置获取到电子邮件模板(Magento)

Php 将自定义配置获取到电子邮件模板(Magento),php,email,magento,Php,Email,Magento,惠。我解释得不太好,但我会尽力的。 如何从magento中的配置获取数据到电子邮件模板。例如,我已经在存储信息上添加了新字段,该字段位于: 配置>常规>存储信息 我添加的字段是gst no,其代码如下所示 system.xml <fields> <gst_no> <label>GST No</label> <

惠。我解释得不太好,但我会尽力的。 如何从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>
换句话说,数据是作为变量工作的。 或者,如果有一种方法可以将GST字段设置为全局变量,比如email、contact phone等。我已经尝试了
{{config path=“general/store_information/GST_no”}
,但不起作用。在php级别上,它的工作方式是
Mage::getStoreConfig('general/store_information/GST_no')


提前感谢:)

你走对了路

在电子邮件模板中添加{{config path=“general/store\u information/gst\u no”}

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

单击Add new variable(添加新变量)并在文本框中填入general/store\u information/gst\u no。允许将设置为“是”


希望这对你有帮助

怎么做?对不起,我解释得不好。我想问的是,从配置到电子邮件调用自定义数据。感谢makwana,它的工作。哈哈:)我想问一点。在这种情况下,我们需要创建添加权限,对吗?如何将常规/存储信息/gst\U编号设置为仅gst\U编号。我的意思是调用{{var store_email}这样的全局变量。{{config path=“general/store\u information/gst\u no”}到{{var store\u gst\u no}
{{var store_email}}