Foundational Module Status

Magento_Store is one of the most foundational modules in the Magento ecosystem. It has zero hard dependencies on other Magento modules, relying only on the Magento Framework. Virtually every other module in Magento depends on Magento_Store.

Zero Module Dependencies

The module.xml for Magento_Store contains no <sequence> entries. This makes it load first among Magento modules, establishing the store context that all other modules rely upon.

Magento_Store
|
+-- Magento\Framework // Core framework classes
| +-- App\ScopeResolverInterface
| +-- App\Config\ScopeConfigInterface
| +-- App\Request\Http
| +-- Url\RouteParamsResolverInterface
| +-- Cache\FrontendInterface
|
+-- PHP Extensions
+-- ext-json
+-- ext-pdo_mysql

Modules That Depend on Store

Nearly every Magento module depends on Magento_Store. Here are the core modules with direct dependencies:

Module Dependency Type Primary Usage
Magento_Catalog Required Store-scoped products, categories, URLs
Magento_Customer Required Customer account per store, website sharing
Magento_Sales Required Orders linked to store views
Magento_Quote Required Cart scoped to store
Magento_Checkout Required Checkout configuration per store
Magento_Cms Required CMS pages/blocks per store view
Magento_Theme Required Theme assignment per store view
Magento_Config Required Scoped system configuration
Magento_UrlRewrite Required URL rewrites per store view
Magento_Indexer Required Store-specific index data

Framework Integrations

ScopeConfigInterface
Core integration for scope-based configuration retrieval. All system configuration values are resolved through the store scope hierarchy.
  • getValue($path, $scopeType, $scopeCode)
  • isSetFlag($path, $scopeType, $scopeCode)
  • Fallback: store -> website -> default
UrlInterface
URL generation integrates with store for base URLs, store codes in paths, and HTTPS enforcement.
  • getUrl() with _scope parameter
  • Store-specific base URLs
  • URL security (HTTPS) per store
LocaleResolverInterface
Locale resolution based on current store view configuration for language, timezone, and currency formatting.
  • general/locale/code per store
  • Timezone per store view
  • Currency formatting locale
FrontControllerInterface
Store resolution happens before controller dispatch via plugins on the front controller.
  • storeCheck plugin (sortOrder: 10)
  • storeCookieValidate plugin (sortOrder: 20)
  • URL-based store resolution
CacheInterface
Store data is cached for performance. Cache tags allow selective invalidation when stores change.
  • CACHE_TAG = 'store_relations'
  • Store::CACHE_TAG for store-specific
  • reinitStores() clears all store caches
CookieManagerInterface
Store selection is persisted in cookies for multi-store switching functionality.
  • Store code cookie management
  • Cookie validation on request
  • Secure cookie handling

REST API Integration

The Store module exposes read-only REST endpoints for retrieving store structure information.

// List all store views GET /rest/V1/store/storeViews Authorization: Bearer {admin_token} // Response [ { "id": 1, "code": "default", "name": "Default Store View", "website_id": 1, "store_group_id": 1, "is_active": 1 } ] // Get store configuration GET /rest/V1/store/storeConfigs // Response includes { "locale": "en_US", "base_currency_code": "USD", "default_display_currency_code": "USD", "timezone": "America/Los_Angeles", "weight_unit": "lbs", "base_url": "https://example.com/", "base_media_url": "https://example.com/media/" }
Read-Only API

The Store REST API only provides GET endpoints. Creating, updating, or deleting stores must be done through the Admin UI or via direct model/repository operations. This is intentional to prevent accidental store structure changes via API.

Database Relationships

Many tables reference the store hierarchy through foreign keys or scope columns.

store_website
|
+-- store_group.website_id FK
| |
| +-- store.group_id FK
|
+-- store.website_id FK (direct reference)
// Other tables referencing store
core_config_data.scope_id -> store.store_id (when scope='stores')
catalog_product_entity_*.store_id
cms_page_store.store_id
sales_order.store_id
customer_entity.website_id
quote.store_id
url_rewrite.store_id

Usage Patterns

Getting Current Store

// In any class - inject StoreManagerInterface public function __construct( StoreManagerInterface $storeManager ) { $this->storeManager = $storeManager; } public function execute() { // Get current store $store = $this->storeManager->getStore(); // Get store ID $storeId = $store->getId(); // Get store code $storeCode = $store->getCode(); // Get website $website = $this->storeManager->getWebsite(); }

Multi-Store Queries

// Get all stores (excluding admin store) $stores = $this->storeManager->getStores(); // Get all stores including admin (store ID 0) $allStores = $this->storeManager->getStores(true); // Get stores keyed by code instead of ID $storesByCode = $this->storeManager->getStores(false, true); // Get all websites $websites = $this->storeManager->getWebsites();

Scoped Configuration

// Inject ScopeConfigInterface public function __construct( ScopeConfigInterface $scopeConfig ) { $this->scopeConfig = $scopeConfig; } // Get config for current store $value = $this->scopeConfig->getValue( 'general/locale/code', ScopeInterface::SCOPE_STORE ); // Get config for specific store $value = $this->scopeConfig->getValue( 'general/locale/code', ScopeInterface::SCOPE_STORE, 'french' // store code );