Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

magento-multi-store

БесплатноБез исполняемых скриптовНе проверен

Configure multiple websites and store views in Magento with shared or scoped catalogs, separate URL structures, and store-specific settings

finsilabsот finsilabs★ 69 звёзд на GitHub

Об этом скилле

Magento Multi-Store Setup

Overview

Magento's multi-store architecture has three levels: Website → Store → Store View. A Website groups stores with a shared customer base and order flow. A Store (under a Website) has its own root category and URL structure. Store Views (under a Store) typically represent languages or locales. Configuration values can be set at Global, Website, or Store View scope — lower scopes override higher ones. Adobe Commerce (B2B) adds Shared Catalogs for per-company product/price visibility control.

When to Use This Skill

  • When running multiple brands or country-specific storefronts from a single Magento installation
  • When setting different base currencies, tax configurations, or payment methods per website
  • When creating a B2B portal alongside a B2C store with different product visibility
  • When implementing localized store views for multiple languages under the same product catalog
  • When configuring separate checkout flows, shipping methods, or payment gateways per website
  • When managing shared product catalog with website-specific pricing and visibility overrides

Core Instructions

  1. Create the Website → Store → Store View hierarchy

    Note: Core Magento does not ship bin/magento store:website:create, store:group:create, or store:store:create CLI commands. Create websites, stores, and store views either through Admin → Stores → All Stores or programmatically in PHP (shown below). Some third-party modules add CLI equivalents, but they are not part of the core.

    Via PHP programmatically (primary method):

    <?php
    // Create website via DataObject
    use Magento\Store\Model\Website;
    use Magento\Store\Model\Group;
    use Magento\Store\Model\Store;
    
    $website = $objectManager->create(Website::class);
    $website->setCode('uk_site')
            ->setName('UK Website')
            ->setDefaultGroupId(0) // Set after creating group
            ->save();
    
    $storeGroup = $objectManager->create(Group::class);
    $storeGroup->setWebsiteId($website->getId())
               ->setName('UK Store')
               ->setRootCategoryId(3) // Your UK root category ID
               ->save();
    
    $storeView = $objectManager->create(Store::class);
    $storeView->setWebsiteId($website->getId())
              ->setGroupId($storeGroup->getId())
              ->setCode('uk_en')
              ->setName('UK English')
              ->setIsActive(1)
              ->save();
    
  2. Configure nginx for multi-website routing

    # /etc/nginx/sites-available/magento-multi-store.conf
    
    # Map host to Magento store code (MAGE_RUN_CODE + MAGE_RUN_TYPE)
    map $http_host $MAGE_RUN_CODE {
        hostnames;
        default         "";
        www.mystore.com "";         # Default (global config)
        uk.mystore.com  uk_en;     # UK store view
        de.mystore.com  de_de;     # German store view
        b2b.mystore.com b2b_en;   # B2B website
    }
    
    map $http_host $MAGE_RUN_TYPE {
        hostnames;
        default         "";
        www.mystore.com "";
        uk.mystore.com  "store";   # Route to store view
        de.mystore.com  "store";
        b2b.mystore.com "website"; # Route to website (different customer base)
    }
    
    server {
        listen 443 ssl http2;
        server_name ~^(.+\.)?mystore\.com$;
    
        root /var/www/magento/pub;
        index index.php;
    
        location ~ \.php$ {
            fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
            fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;
            fastcgi_param MAGE_RUN_TYPE $MAGE_RUN_TYPE;
            include fastcgi_params;
        }
    }
    
  3. Set scoped configuration values

    Configuration can be set at global, website, or store view scope:

    # Set base URL per website
    bin/magento config:set --scope=websites --scope-code=uk_site web/secure/base_url "https://uk.mystore.com/"
    bin/magento config:set --scope=websites --scope-code=uk_site web/unsecure/base_url "https://uk.mystore.com/"
    
    # Set currency per website
    bin/magento config:set --scope=websites --scope-code=uk_site currency/options/base GBP
    bin/magento config:set --scope=websites --scope-code=uk_site currency/options/default GBP
    bin/magento config:set --scope=websites --scope-code=uk_site currency/options/allow "GBP,EUR"
    
    # Set locale per store view
    bin/magento config:set --scope=stores --scope-code=de_de general/locale/code de_DE
    bin/magento config:set --scope=stores --scope-code=de_de general/locale/timezone "Europe/Berlin"
    
    # Disable a payment method for specific website
    bin/magento config:set --scope=websites --scope-code=uk_site payment/checkmo/active 0
    

    Programmatically in PHP:

    <?php
    use Magento\Framework\App\Config\Storage\WriterInterface;
    use Magento\Store\Model\ScopeInterface;
    
    class ScopeConfigManager
    {
        public function __construct(
            private readonly WriterInterface $configWriter,
            private readonly \Ma
    
Полный SKILL.md на GitHub

Установить magento-multi-store в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

claude-code
cursor
gemini-cli
copilot
codex-cli
kiro
opencode

Вложенные файлы

evals/cli-website-provisioning-script/criteria.jsonevals/cli-website-provisioning-script/task.mdevals/nginx-multi-store-routing-config/criteria.jsonevals/nginx-multi-store-routing-config/task.mdevals/php-scoped-config-and-product-assignment/criteria.jsonevals/php-scoped-config-and-product-assignment/task.mdtile.json

FAQ

Что делает скилл magento-multi-store?

Configure multiple websites and store views in Magento with shared or scoped catalogs, separate URL structures, and store-specific settings

Как установить скилл magento-multi-store?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл magento-multi-store запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить magento-multi-store с