Magento Website / Store Groups / Store Views

Magento Website / Store Groups / Store Views

Magento is much flexible and provide us a gteat flexibility for multistore setup.But there is a common confusion between Website,Store & Store View.

If you login to your Magento backend and
go to System > Manage Store

There you'll find the terms "Website", "Store" and "Store view". This is really confusing as soon as you start digging into the code because there those terms are mapped to "Website", "Store Group" and "Store View":

Backend  Label  Website Store Store View

Model Class
Mage_Core_Model_Website Mage_Core_Model_Store_Group Mage_Core_Model_Store
Database Table core_website core_store_group core_store

To always be clear I'll stick to the terms "Website", "Store Group" and "Store View".
In addition to these configurable layers there is also the "default" scope. This makes four layer where  stuff can be configured. But note that you can't do everything in all scopes.
Here's a matrix of what features are supported by which layer/scope:


Default
Website
Store Group
Store View
Product settings
X
X
Product prices
X
X
Product tax class
X
X
Base currency
X
X
(Default) display currency
X
X
Category settings
X
X
System configuration settings
X
X
X
Root category configuration
X
Orders
X
Customers
X
X

Behind the scenes

The table and class structure is not very clean: There is some redundant data. Also note that the website has an own flag describing if it is the default website or not, while store group's and store view's default status will be managed by their respective parent objects.
The store view is the only entity of those that can be in an deactivated state. 
Magento always runs in a specific store. If noone is explictly set (e.g. by server variable MAGE_RUN_CODE or by get paremter in the url) the default store in the default store group of the default website will be displayed. 
The store groups feel somehow superfluous as their own purpose seems to be defining the root category the stores attached to it.
Basically websites, store groups and store views build an hierarchic structure. Too bad this isn't reflected by Magento's default interface for managing those.

Comments

Popular posts from this blog

Category Name with Products in Cart Page Magento

Safe name of a file by php

Sort Products by popularity count in Magento