将自定义配置放入电子邮件模板(Magento)


get custom configuration into email template (Magento)

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

配置>常规>存储信息

我添加的字段是gstno,它是下面的代码。

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');

提前感谢:)

你正朝着正确的方向前进。

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

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

单击添加新变量,并在文本框中填充general/store_information/gst_no。将是否允许设置为

希望这对你有帮助!