Magento安装之后就有一个叫Main Website的网站,并且其默认的商店和商店视图也创建好了。
管理的位置在System/Manage Stores

可以看到,这里有三个基本操作,不过需要首先明白,一个所谓的Website可以有多个Store, 而一个Store可以对应多个Store View,所以如果全新开始设置的时候先是设置一个Website,然后创建一个或多个Store放入Website中,然后创建Store View放入对应的Store中。
创建一个新Website:

有两个字段必填,这些信息会写入core_website表中。当创建了Store后回来编辑Website,如下:

多出了Default Store和Set as Default这两个选择,说明Website有一个默认Store的概念。这个Set as Default就是设置当前这个Website的Store作为默认首先进入的网站,由于Magento支持多网站,所以也有一个默认网站的问题。
创建新的Store:

这个时候需要选择这个商店属于哪个Website,然后是这个商店的名字,接下来就是这个商店对应的根目录(可能需要创建针对此商店的新的根目录),这些信息会写入core_store表中。
不过需要注意的时候,为这个Store建立的第一个Store View后,这个Store Virew就是这个Store的默认商店视图。可以返回来编辑这个Store发现:

多了Default Store View,事实上,当创建Store时无法知道默认的Store View,当创建了第一个Store View后,这个Default Store View就是第一个Store View,如果创建了多个Store View,那么这里就可以选择哪个作为默认的Store View了。
新建Store View:

需要选择它归属于哪个Store,Status标示它是否启用。这些信息写入core_store表中。
对应数据库结构关系:

core_store引用了core_store_group 和 core_website,其实它只要引用core_store_group就可以了,不过逻辑上core_store也属于core_website,所以它也引用core_website,同时从core_store定位它的core_website时,可以不需要经过core_store_group表,貌似提升效率。
core_store_group引用了core_website。
core_website和core_store_group和core_store分别对应Website和Store和Store View的概念。
core_website和core_store是系统最核心的表,它实现了多网站概念,其它的很多表都要引用它们。
三个表的详情:

注意default_group_id 和 is_default这两个字段。

注意root_category_id和default_store_id。
 (责任编辑:最模板) |