I am working in magento 1.9 . I have created a custom tab in admin -> configuration . There I created custom fields , I want to save the data from those custom fields on click "save config" button. Here is my code from system.xml

 <section_two translate="label">

This my code from .phtml


    $counter = 1;
    $storeId  = Mage::app()->getStore()->getStoreId();
    $configValue = Mage::getStoreConfig('LtlFreight/section_two/carriers',$storeId);
    $output_data = array();
    $output_data= json_decode($configValue);

    foreach($output_data as $key=>$config_data){

        foreach($config_data as $k => $data){
            echo "<tr>";
            echo "<td>";
               echo  $counter;
            echo "</td>";
            echo "<td>";
               echo $data->CarrierName;
            echo "</td>";  
            echo "<td>";
               echo '<img src="'.$data->CarrierLogoUrl.'"  height="50" width="70">';
            echo "</td>";
            echo "<td>";
               echo '<input type="checkbox" name="" value="'.$data->CarrierSCAC.'"  class="cerasisQuoteServices" >' ;
            echo "</td>";
            echo "</tr>";


Here I want to save the values of checkboxes on click "save config" button . Anybody please tell the procedure .

  • data on system > configuration page is saved automatically on save. Oct 23, 2018 at 14:23
  • can you post your all files here with full code ? Oct 23, 2018 at 21:09

2 Answers 2


in your config.xml add code as follows:


and declare the observer as

class Vendor_Extension_observer {
     public function yourmethod(Varien_Event_Observer $observer){

         //To get Request parameters in the Observer, use following code

         //To get post variable
  • Hi! Thank you for your help , could you please tell me where should i place your code in config.xml? should i place it in event tag or in default tag ? Oct 23, 2018 at 14:36
  • can you please tell me how to get the post data of config data (actually i only want to get the selected values from checkboxes in post) Oct 23, 2018 at 15:36
  • 1
    you need to add code into <events> into config.xml. Oct 24, 2018 at 4:01
  • 1
    I update answer with, how we can get params or post value. you can check it. And if answer help, mark as solution so it will help other in community as well. Oct 24, 2018 at 4:04
  • thank you for your help , but i want to get the values of selected checkboxes from custom config data . but Mage::app()->getRequest()->getParams(); did show that data . thank you in advance . Oct 24, 2018 at 5:42

It is better to check section name, otherwise, the method will fire not only when you need.

    public function yourmethod(Varien_Event_Observer $observer){
 $section = Mage::app()->getRequest()->getParams();
            if ($section['section'] == 'YOUR_SECTION_NAME') {
    $fieldsData = Mage::app()->getRequest()->getPost(groups)[YOUR_GROUP][fields];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.