Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save evgv/f279f3c3c1c5ad08e14616c178cbb13e to your computer and use it in GitHub Desktop.
Save evgv/f279f3c3c1c5ad08e14616c178cbb13e to your computer and use it in GitHub Desktop.
Magento. Save core config data using install script

Magento. Save core config data using install script

Add install/upgrade script, and run migration.
Method saveConfig() has 2 required parameters ($path and $value) and 2 optional ($scope that equal default by default and $scopeId that equal 1 by default). More info you can see in class Mage_Core_Model_Config.

    <?php

    $installer = $this;
    $installer->startSetup();

    /* @var $setup Mage_Core_Model_Config */
    $setup = Mage::getModel('core/config');
    $setup->saveConfig('customer/address/street_lines', 4);

    $installer->endSetup();

or

    <?php

    $installer = $this;
    $installer->startSetup();

    $setup = new Mage_Core_Model_Config();
    $setup->saveConfig('customer/address/street_lines', 4);

    $installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment