1.13

Stores, Websites, and Store Views

Understanding the scope system is essential for managing multi-store Magento implementations with different languages, currencies, and pricing.

Why This Matters: Understanding scope is essential for multi-store Magento implementations. It controls how attributes, prices, and configuration values differ across websites, store groups, and store views.

Scope Hierarchy Overview

mindmap root((Scope System)) Hierarchy Website Store Group Store View Terminology Developer: Store Group/Store Merchant: Store/Store View Scope Levels Global scope=1 Website scope=2 Store scope=0 What Uses Scope EAV Attributes System Configuration Prices Translations Storage catalog_eav_attribute catalog_product_entity_* core_config_data

What is Scope in Magento?

The scope concept in Magento 2 is the ability for attributes and configuration values to have different values in different circumstances.

Primary Use Cases:
  • Prices - Different prices or currencies for different locations
  • Translations - Different language values (e.g., "red" vs "rouge")
  • Configuration - Different settings per website/store

Price Example

A product available in multiple locations:

  • US Website: $100 USD
  • EU Website: €90 EUR
  • UK Website: £85 GBP

Same product, different values per scope.

Translation Example

A color attribute for a product:

  • English Store: "Red"
  • French Store: "Rouge"
  • Spanish Store: "Rojo"

Same attribute, different values per store.

The Scope Hierarchy

Terminology Alert!

Magento has confusing terminology depending on the audience:

Developers/Code:
  • Website
  • Store Group
  • Store
Merchants/Admin UI:
  • Website
  • Store
  • Store View

This documentation uses developer terminology (Website → Store Group → Store), but understand that merchants see it as Website → Store → Store View.

Hierarchical Structure

The three scope elements are hierarchical:

Website
  └── Store Group(s)
      └── Store(s) / Store View(s)
Relationships:
  • Each Store belongs to exactly one Store Group
  • Each Store Group belongs to exactly one Website
  • A Website may have many Store Groups (one-to-many)
  • A Store Group may have many Stores (one-to-many)

The Three Scope Levels

1. Website

The highest level in the scope hierarchy.

Primary Purposes:
  • Separate customer accounts and orders
  • Different catalogs or pricing structures
  • Different payment/shipping methods
  • Attributes with is_global = 2 can have different values
Example Use Case: Separate B2B and B2C websites with different customer groups and pricing.

2. Store Group (aka "Store" in Admin)

The middle level - acts as a container for Stores.

⚠️ Important: Store Groups do NOT participate directly in scoping functionality!
Primary Purposes:
  • Define a unique root category
  • Act as a container for multiple stores
  • Share the same catalog structure
Example Use Case: Different root categories for "Men's Store" vs "Women's Store" under the same website.

3. Store / Store View

The lowest level in the hierarchy - what customers actually see.

Primary Purposes:
  • Different languages/localizations
  • Different currencies
  • Attributes with is_global = 0 can have different values
  • Different designs/themes
Example Use Case: English store view, French store view, and Spanish store view all under the same website and store group.

EAV Attribute Scope

Each EAV attribute has a scope property that determines at which level it can have different values.

catalog_eav_attribute table → is_global field
⚠️ Important: is_global is NOT a boolean flag! It accepts three distinct values.

is_global Values

is_global Value Scope Level Meaning Example Use Case
0 Store View Attribute can have different values per store view Product name, description (translations)
1 Global Single value across all scopes (no separated values) SKU, product type, creation date
2 Website Attribute can have different values per website Price, special price, tax class

is_global = 0

Store Scope

Different value for each Store View. Perfect for translations.

is_global = 1

Global Scope

Same value everywhere. Cannot be overridden.

is_global = 2

Website Scope

Different value per Website. Used for prices.

Where Scope Data is Stored

EAV Attribute Values

Attribute values are stored in corresponding EAV tables based on data type:

Common EAV Tables:
  • catalog_product_entity_int - Integer values
  • catalog_product_entity_varchar - String values
  • catalog_product_entity_decimal - Decimal values (prices)
  • catalog_product_entity_text - Long text values
  • catalog_product_entity_datetime - Date/time values

Each record includes a store_id column to identify which scope the value applies to.

System Configuration Values

core_config_data table

All system configuration values for all scopes are stored in the core_config_data table.

Key Columns:
  • scope - 'default', 'websites', or 'stores'
  • scope_id - The ID of the website or store
  • path - Configuration path (e.g., 'general/locale/code')
  • value - The configuration value

Scope in Practice

Example: Multi-Website Setup

Website: US Site (ID: 1)
  └── Store Group: Main Store (ID: 1, Root Category: "Default")
      ├── Store View: English (ID: 1, Code: en_us)
      └── Store View: Spanish (ID: 2, Code: es_us)

Website: EU Site (ID: 2)
  └── Store Group: European Store (ID: 2, Root Category: "EU Catalog")
      ├── Store View: English UK (ID: 3, Code: en_gb)
      ├── Store View: French (ID: 4, Code: fr_fr)
      └── Store View: German (ID: 5, Code: de_de)
Scope Behavior:
  • Price (is_global=2): Different for US Site vs EU Site
  • Product Name (is_global=0): Different for each Store View
  • SKU (is_global=1): Same everywhere

Real-World Example

Product: T-Shirt (SKU: TSH-001)

Global Attributes:
  • SKU: TSH-001 (same everywhere)
  • Type: Simple Product
Website Scope (Price):
  • US Website: $29.99
  • EU Website: €24.99

Store View Scope (Translations)

Name:
  • English: "Red Cotton T-Shirt"
  • French: "T-Shirt en Coton Rouge"
  • Spanish: "Camiseta de Algodón Roja"
Description:
  • English: "Comfortable cotton..."
  • French: "Coton confortable..."
  • Spanish: "Algodón cómodo..."

Scope Priority and Fallback

Magento uses a fallback mechanism when retrieving scoped values:

Fallback Order (most specific to least specific):
  1. Store View - Check if value exists for current store view
  2. Website - If not, check if value exists for current website
  3. Global/Default - If not, use the global default value
Example: If a product name is not set for the French store view, Magento will fall back to the website level, and if not set there, to the global default value.

Important Distinctions

What Scopes Control

  • ✅ EAV attribute values
  • ✅ System configuration settings
  • ✅ Prices and special prices
  • ✅ Product names and descriptions
  • ✅ URL rewrites
  • ✅ CMS content

What Scopes Don't Control

  • ❌ Static phrase translations (uses i18n)
  • ❌ Product inventory (separate concept)
  • ❌ Customer accounts (shared per website)
  • ❌ Orders (belong to website/store)

Localization Note

Static phrase translations (like "Add to Cart", "Checkout", etc.) work differently and are handled through the i18n system, not the scope system. See topic 1.08 for more details on localization.

Quick Reference Table

Concept Developer Term Merchant Term Key Purpose
Top Level Website Website Separate catalogs, customers, orders
Middle Level Store Group Store Root category container (no direct scoping)
Bottom Level Store Store View Language, currency, localization
is_global Value Scope Name Can Override Per... Common Examples
0 Store View Each store view Name, description, color
1 Global Cannot override SKU, product type, status
2 Website Each website Price, special price, tax class

Exam Tips

Key Points to Remember

  • Understand the terminology difference: Store Group (code) vs Store (UI)
  • Hierarchy: Website → Store Group → Store (one-to-many relationships)
  • Store Groups do NOT participate directly in scoping - only define root categories
  • is_global values: 0 = Store, 1 = Global, 2 = Website
  • EAV values stored in catalog_product_entity_* tables
  • Config values stored in core_config_data table
  • Scope defines where attributes can have different values
  • Prices are typically website scope (is_global = 2)
  • Translations are typically store scope (is_global = 0)
  • Static phrase translations use the i18n system, not scopes

Further Reading