To add custom section In system configuration, you have to create a Magento module, you can create by following below steps,
- Where
Vendor_Module
is you module (Vendor
is your company name and Module
is your module name, you can write whatever you want)
app/etc/modules/Vendor_Module.xml
<?xml version="1.0"?>
<config>
<modules>
<Vendor_Module>
<active>true</active>
<codePool>local</codePool>
</Vendor_Module>
</modules>
</config>
create a new directory in local
(app>code>local) with Vendor
and Module
, so It should like this, and create a new config.xml
app/code/local/Vendor/Module/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Vendor_Module>
<version>1.0.0</version>
</Vendor_Module>
</modules>
<global>
<helpers>
<class>Vendor_Module_Helper</class>
</helpers>
</global>
</config>
now, create system.xml
in etc
directory, like this,
<?xml version="1.0"?>
<config>
<sections>
<shippinginfo translate="label" module="module">
<label>YOUR_LABEL</label>
<tab>general</tab>
<sort_order>60</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<shipping_times>
<fields>
<monday translate="label">
<label>Monday</label>
<frontend_type>text</frontend_type>
<comment>e.g 17.00</comment>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</monday>
<tuesday translate="label">
<label>Tuesday</label>
<frontend_type>text</frontend_type>
<comment>e.g 17.00</comment>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</tuesday>
<wednesday translate="label">
<label>Wednesday</label>
<frontend_type>text</frontend_type>
<comment>e.g 17.00</comment>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</wednesday>
<thursday translate="label">
<label>Thursday</label>
<frontend_type>text</frontend_type>
<comment>e.g 17.00</comment>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</thursday>
<friday translate="label">
<label>Friday</label>
<frontend_type>text</frontend_type>
<comment>e.g 17.00</comment>
<sort_order>50</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</friday>
<saturday translate="label">
<label>Saturday</label>
<frontend_type>text</frontend_type>
<comment>Leave blank If its non shipping day</comment>
<sort_order>60</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</saturday>
<sunday translate="label">
<label>Sunday</label>
<frontend_type>text</frontend_type>
<comment>Leave blank If its non shipping day</comment>
<sort_order>70</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</sunday>
</fields>
</shipping_times>
</groups>
</shippinginfo>
</section>
</config>
now create a helper
class
in helper
directory, like this
<?php
class Vendor_Module_Helper_Data extends Mage_Core_Helper_Abstract
{
}
refresh your cache, and check
And you don't need to save this value, Magento will manage this and you can get save value by using
Mage::getStoreConfig('shippinginfo/shipping_times/monday');
System > Configuration
then you don't need to create table or write code. Magento will automatically save data ofSystem > Configuration
fields tocore_config_data
table with its path.