"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: 20 October, 2020

Views: 3,018



Social Sharing
Search