Logo
X
  • Who We Serve
    • By Role

      • CEO / Business Executives
      • CTO / IT Professionals
      • COO / Operations Head
    • By Industries

      • Healthcare
      • Digital Commerce
      • Travel and Transportation
      • Real Estate
      • Software and Technology
  • Our Technology Focus
    • Web
    • Mobile
    • Enterprise
    • Artificial Intelligence
    • Blockchain
    • DevOps
    • Internet Of Things
  • Discover Daffodil
    • About
    • Leadership
    • Corporate Social
      Responsibility
    • Partners
    • Careers
  • Resources
    • Blog

    • E-Books

    • Case Studies

    • View all resources

  • Who We Serve
    • By Role

      • CEO / Business Executives
      • CTO / IT Professionals
      • COO / Operations Head
    • By Industries

      • Healthcare
      • Digital Commerce
      • Travel and Transportation
      • Real Estate
      • Software and Technology
  • Our Technology Focus
    • Web

      Create responsive web apps that excel across all platforms

    • Mobile

      User centric mobile app development services that help you scale.

    • Enterprise

      Innovation-driven enterprise services to help you achieve more efficiency and cost savings

      • Domains
      • Artificial Intelligence
      • DevOps
      • Blockchain
      • Internet Of Things
  • Discover Daffodil
    • About
    • Leadership
    • Corporate Social Responsibilities
    • Partners
    • Careers
  • Resources
    • Blog

      Insights for building and maintaining your software projects

    • E-Books

      Our publications for the connected software ecosystem

    • Case Studies

      The impact that we have created for our clients

    • View all resources
daffodil-logo
Get in Touch
  • What We Do
    • Product Engineering

    • Discover & Frame Workshop
    • Software Development
    • Software Testing
    • Managed Cloud Services
    • Support & Maintenance
    • Smart Teams

    • Dedicated Teams
    • Offshore Development Centre
    • Enterprise Services

    • Technology Consulting
    • Robotic Process Automation
    • Legacy Modernization
    • Enterprise Mobility
    • ECM Solutions
  • Who We Serve
    • By Industry

    • Healthcare
    • Software & Technology
    • Finance
    • Banking
    • Real Estate
    • Travel & Transportation
    • Public Sector
    • Media & Entertainment
    • By Role

    • CEO / Business executives
    • CTO / IT professionals
    • COO / Operations
  • Our Expertise
    • Mobility
    • UI/UX Design
    • Blockchain
    • DevOps
    • Artificial Intelligence
    • Data Enrichment
    • Digital Transformation
    • Internet of Things
    • Digital Commerce
    • OTT Platforms
    • eLearning Solutions
    • Salesforce
    • Business Intelligence
    • Managed IT Services
    • AWS Services
    • Application Security
    • Digital Marketing
  • Case Studies
  • Discover Daffodil
    • About us
    • Partnership
    • Career & Culture
    • Case Studies
    • Leadership
    • Resources
    • Insights Blog
    • Corporate Social Responsibility
Get in Touch
resources-bg.jpg

Software Engineering Insights

Setting up Multiple Websites, Stores & Views on Magento

Sep 2, 2015 2:00:05 PM

  • Tweet

Magento is such a magical portal. The many things a developer can work with using Magento is simply inspiring. There are hardly any two thoughts raised when someones says that Magento is the most trusted eCommerce portal in the world. Even Alexa puts about 10,000 Magento sites in the world’s top 1 million sites.

That is quite a substantial number compared to Magento’s other competitors viz Prestashop, Shopify, WooCommerce etc.

Magento meta-chart

Magento users understand the potential of the technology they are using and in order to siphon maximum business benefits they use utilizing their technology to the maximum benefits. This will require many users accessing the admin panel and also working separately on multiple websites, stores and views to effectuate a sublime workflow.

In Magento, we can add multiple website, stores and store views. Normally we can easily create these from the admin panel but sometimes we are required to create a script. For example, if more than one user is working on same project then we don't prefer that every developer will create website individually in its admin. Instead of this, let they can use the installer file to create multiple website, stores and views.

New Call-to-action

Code: We are creating a website "website1", a store "store1" and store views "view_nl", "view_fr" and "view_en".

[php]//#addWebsite
/** @var $website Mage_Core_Model_Website */
$website = Mage::getModel('core/website');
$website->setCode('website1')
->setName('website1')
->save();[/php]

[php]//#addStoreGroup
/** @var $storeGroup Mage_Core_Model_Store_Group */
$storeGroup = Mage::getModel('core/store_group');
$storeGroup->setWebsiteId($website->getId())
->setName('store1')
->setRootCategoryId(2)
->save();[/php]

[php]//#addStores
/** @var $store Mage_Core_Model_Store */
$store1 = Mage::getModel('core/store');
$store1->setCode('view_nl')
->setWebsiteId($storeGroup->getWebsiteId())
->setGroupId($storeGroup->getId())
->setName('View NL')
->setIsActive(1)
->save();[/php]

[php]$store2 = Mage::getModel('core/store');
$store2->setCode('view_fr')
->setWebsiteId($storeGroup->getWebsiteId())
->setGroupId($storeGroup->getId())
->setName('View FR')
->setIsActive(1)
->save();[/php]

[php]$store3 = Mage::getModel('core/store');
$store3->setCode('view_en')
->setWebsiteId($storeGroup->getWebsiteId())
->setGroupId($storeGroup->getId())
->setName('View EN')
->setIsActive(1)
->save();[/php]

The above code will work smoothly on any Magento based portal and will most definitely accelerate your admin processes.

Magento holds a thousand wondrous secrets behind its doors, the above is just a key to unlock one of those secrets. I have been and will continue to provide you the keys to Magento’s various surprise features along with the codes to access it through my coming blog posts. So stay tuned with more news regarding Magento and other technologies by subscribing to the Daffodil blog.

Topics: Digital Commerce Open Source

Ankita Agrawal

Written by Ankita Agrawal

Ankita Agrawal is leading Magento team and providing best in class e-commerce products and aimed at client satisfaction. She is very good at innovating and implementing latest marketplace solutions. Having a great experience of providing customized and featured products, she fits best for handling higher complexity projects.

Previous Post

previous_post_featured_image

Magical CRUD and Performance Levels

Next Post

next_post_featured_image

"The Future of Mobile Apps" is the Future of Everything Now

Stay Ahead of the Curve with Our Weekly Tech Insights

  • Recent
  • Popular
  • Categories

Lists by Topic

  • Software Development (174)
  • Artificial Intelligence (169)
  • Mobile App Development (166)
  • Healthcare (137)
  • DevOps (80)
  • Digital Commerce (60)
  • Web Development (57)
  • CloudOps (54)
  • Digital Transformation (37)
  • Fintech (36)
  • UI/UX (29)
  • On - Demand Apps (26)
  • Software Architecture (26)
  • Internet of Things (IoT) (25)
  • Open Source (25)
  • Outsourcing (24)
  • Blockchain (21)
  • Newsroom (21)
  • Salesforce (21)
  • Technology (18)
  • Software Testing (16)
  • StartUps (16)
  • Customer Experience (14)
  • Robotic Process Automation (13)
  • Voice User Interface (13)
  • Javascript (11)
  • OTT Apps (11)
  • Business Intelligence (10)
  • Data Enrichment (10)
  • Infographic (10)
  • Big Data (9)
  • Education (9)
  • Microsoft (6)
  • Real Estate (5)
  • Banking (4)
  • Game Development (4)
  • Enterprise Mobility (3)
  • Hospitality (3)
  • eLearning (2)
  • Public Sector (1)
see all

Posts by Topic

  • Software Development (174)
  • Artificial Intelligence (169)
  • Mobile App Development (166)
  • Healthcare (137)
  • DevOps (80)
  • Digital Commerce (60)
  • Web Development (57)
  • CloudOps (54)
  • Digital Transformation (37)
  • Fintech (36)
  • UI/UX (29)
  • On - Demand Apps (26)
  • Software Architecture (26)
  • Internet of Things (IoT) (25)
  • Open Source (25)
  • Outsourcing (24)
  • Blockchain (21)
  • Newsroom (21)
  • Salesforce (21)
  • Technology (18)
  • Software Testing (16)
  • StartUps (16)
  • Customer Experience (14)
  • Robotic Process Automation (13)
  • Voice User Interface (13)
  • Javascript (11)
  • OTT Apps (11)
  • Business Intelligence (10)
  • Data Enrichment (10)
  • Infographic (10)
  • Big Data (9)
  • Education (9)
  • Microsoft (6)
  • Real Estate (5)
  • Banking (4)
  • Game Development (4)
  • Enterprise Mobility (3)
  • Hospitality (3)
  • eLearning (2)
  • Public Sector (1)
see all topics

Elevate Your Software Project, Let's Talk Now

Awards & Accolades

dj
dj
dj
dj
dj
Aws-certification-logo
microsoft-partner-2-1
microsoft-partner
google-cloud-partne
e-UI-Path-Partner-logo
partner-salesforce-reg-consulting-partner-1-1
daffodil-logo
info@daffodilsw.com
  • Home
  • About Daffodil
  • Locations
  • Privacy Policy
  • Careers

© 2025 Daffodil Unthinkable Software Corp. All Rights Reserved.

[fa icon="chevron-up"]