"Create website" programmatically in magento 1.6

To Create website use model "Mage_Core_Model_Website". We must specify Website Name and Website Code.

Website Name - Name of your website. e.g. My Website.

Website Code - For each website Website Code must be unique. This code can have text, but cannot have special characters and spaces. It would be good to use "mywebsite" as website code for website "My Website".

You can use following script to create website in magento v1.6.

  $websiteName = "My Website";
  $websiteCode = "mywebsite";

  $website = Mage::getModel('core/website');
  $website->setCode($websiteCode)
          ->setName($websiteName)
          ->save();

 

Tutorial may help you:

Create Store Group programatically in magento

Create Root Category programatically in magento

Created At: 22 December, 2024

Views: 4,409



Social Sharing
Search