문제

I added some fields to core_config_data through system.xml of my module. as shown below:

        <groups>
            <hot_deals translate="label">
                <label>Hot deals</label>
                <frontend_type>text</frontend_type>
                <sort_order>0</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>
                <fields>
                    <deals_category_id translate="label">
                        <label>Deals category id</label>
                        <frontend_type>text</frontend_type>
                        <show_in_default>1</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </deals_category_id>
                </fields>
            </hot_deals>
       </groups>

I want to apply some default value to the above created text field by changing the above system.xml file such that if user tried to empty the field and save then also the text field should hold the default value. In other cases like when the user altered the value, the new value should be store in the table.

Is it possible?

I can do this easily in phtml files by using if else statement but the problem is that there are many phtml files which need this change.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top