Merchant Stories

Configuring Magento ®: What Ecom Store Owners Must Know Now

Jan 26, 2015 2 min read 567 views
Listen audio
Configuring Magento ®: What Ecom Store Owners Must Know Now

Despite the fact that the Magento ® administrative panel is quite large and complicated the configuration system in it is very simple. Let’s start from the beginning and figure out why we need it at all.

Configuration system is a universal place where system variables are stored, including modules and plug-ins.  Should you need to modify some of your extensions for Magento ®. And this will only be possible due to the configuration system because it allows you the ability to not only read the files but modify them. This makes the configuration system so required and appreciated by the users of Magento ®.

First of all, it is very important to know the order of the configuration files upload. They are usually loaded from the system cache. However, sometimes there is no cache, it is outdated or disabled. Then configuration files are created and placed in the root system directories:

{root_dir}/app/etc/config.xml
{root_dir}/app/etc/modules/*.xml
{root_dir}/app/etc/local.xml

 

 

When it is impossible to upload local.xml, the file {root_dir}/app/etc/distro.xml is uploaded instead. Then, you should upload the configuration files {module_dir}/etc/config.xml for all enabled (active == true) modules. Then the database configuration files are read: information about websites (core_website tables), information about stores (core_store table) and the main configuration (core_config_data table).

Let us review the changes in the admin panel using an example of UPS module in which we need to add ‘overprice’ parameter with the default setting 7. This module adds $7 to each ordered product which corresponds to the shipping price of UPS company. In order to do this, we need to open the file shipping.xml and add the following code.

<config>
<default>
<carriers>
<ups>
<overprice>7</overprice>
</ups>
</carriers>
</default>
</config>

 

 

In order for this configuration to be displayed in the admin panel, we need to add the following code to file shipping.xml in Shipping methods – UPS section.

<config>
<sections>
<carriers>
<groups>
<ups>
<fields>
<overprice translate="label">
<label>Flat shipping fee for all parts/accessories purchases totaling less than minimum 
order amount for free shipping</label>
<frontend_type>text</frontend_type>
<sort_order>333</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
</overprice>
</fields>
</ups>
</groups>
</carriers>
</sections>
</config>

 

 

In order for these changes to be displayed in the admin panel and applied on the site, we need to add the following code in app/Mage.php file:

public function getConfigData($field)
{
if (empty($this->_code)) {
return false;
}
$path = 'carriers/'.$this->_code.'/'.$field;
return Mage::getStoreConfig($path, $this->getStore());
}

 

 

The principle of work of this specific configuration is that, due to the settings in xml files, the system can read all information but show only some specific data to your customers, including the data written in configuration files by default. In this case, it is $7 shipping price of UPS company.

All configuration modifications are stored in core_config_data table.

If you have any additional questions, please feel free to leave your comments or contact us directly, and our GoMage experts will do their best to assist you.

That's where you contact us!

    By submitting this form you agree to GoMage's Terms of Use and Privacy Policy
    woo-hoo! Now its time to keep checking your inbox, as we will be getting in touch soon. Promise :)
    oops! Thanks. But it seems like some kind of technical issues stop you from meeting GOMAGE. Could you try again?