Menu

Multi-store is built in: Magento 2 scopes vs Laravel config and tenancy packages
📰

Multi-store is built in: Magento 2 scopes vs Laravel config and tenancy packages

DEV Community: laravel·Nikita Sirenko·9 days ago
#GUCnKduX
#devtolaravel#devto#dev#store#config
Long article (981 words) — no AI summary yet.
Reading 0:00
15s threshold

One store I've supported since 2023 runs 6 store views from one Magento 2 install: 2 websites with 3 store views each, one catalog and one admin. The EU website sells in euros and the Swiss one in Swiss francs, with prices set per website and not converted. Locale and texts are set per store view, down to the withdrawal confirmation emails. The countries a customer can choose differ per website.

Magento has that in the core. Laravel leaves it to you, and the two packages people reach for cover a different case.

Three levels in the core

Magento 2 keeps configuration at 3 levels: default, website and store view. A value saved in the admin or with config:set is a row in core_config_data , one per scope, scope ID and path. The scope column holds default , websites or stores .

Read a value for a store view, and you get the store view's value, else its website's, else the default, else the module's config.xml . A value locked in app/etc/env.php or config.php beats all of them.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.