1

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

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();
  • Website and store view name is change but store name is not changing. – Mathew Sep 22 '15 at 8:53
  • please check now,it works – Amit Bera Sep 22 '15 at 9:41
  • Yes it works correctly.... – Mathew Sep 23 '15 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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