1

I want edit store name and website name programatically, how it is possible?

1 Answer 1

3

Updated

For store try this

$storeModel = Mage::getModel('core/store_group');

//  Load by store Id:

 $storeModel->load($id);

 $storeModel->setData('name','Amit');
 $storeModel->save();

For Website:

$websiteModel = Mage::getModel('core/website');
$websiteModel->load($WebsiteId);
$websiteModel->setData('name','MYStoreWebsite');
$websiteModel->save();

You can easily do it by shell script. Create a file update.php in your Magento directory and add the following code:

require "YourMagentoDirPath/app/Mage.php";
umask(0);
Mage::app('admin');

$storeModel = Mage::getModel('core/store_group');

//  Load by store Id:
$storeModel->load($id);

$storeModel->setData('name','Amit');
$storeModel->save();

$websiteModel = Mage::getModel('core/website');
$websiteModel->load($WebsiteId);
$websiteModel->setData('name','MYStoreWebsite');
$websiteModel->save();
3
  • Website and store view name is change but store name is not changing.
    – Mathew
    Commented Sep 22, 2015 at 8:53
  • please check now,it works
    – Amit Bera
    Commented Sep 22, 2015 at 9:41
  • Yes it works correctly....
    – Mathew
    Commented Sep 23, 2015 at 4:31

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.