Mohd Nizam
Mohd Nizam

Reputation: 47

get custom configuration into email template (Magento)

hyee . im not so good in explanation, but i'll try. how to get data from configuration in magento to email template. example, i'll already add new field on store information which is on:

Configuration > General > Store Information

field that i add is gst no which is the code as below.

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>

and it function as expected. now how do i call this value on email template. example like

{{var store_email}}

on the other words, data is work as variable. or if there is a way to set GST field as global variable like email, contact phone and etc. I already try {{config path="general/store_information/gst_no"}} but is not work.On php level it would be work like thisMage::getStoreConfig('general/store_information/gst_no');

thanks in advance :)

Upvotes: 1

Views: 2395

Answers (1)

Makwana Ketan
Makwana Ketan

Reputation: 1388

You are going to the right way.

Add {{config path="general/store_information/gst_no"}} in you email template.

Now Login to admin panel and navigate to System->Permissions->Variables

Click on Add new variable and fill the text box with general/store_information/gst_no. Set Is Allowed to yes

Hope this helps you!

Upvotes: 3

Related Questions