Установка интернет-магазина на Drupal 8 SiteCommerce через Composer

1. Установка ядра Drupal

Установка будет выполнена в папку www. В данном случае папка www – это родительская папка корневой директории сервера. В drupal-project в качестве корневой директории сервера используется папка web.

Перед установкой рекомендуется очистить кэш

composer clearcache
composer create-project drupal-composer/drupal-project:8.x-dev www --stability dev --no-interaction

2. Добавление новых репозиториев библиотек js в корневой composer.json

    "repositories": [{
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "package",
            "package": {
                "name": "fancyapps/fancybox",
                "version": "3.3.5",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/fancyapps/fancybox/archive/v3.3.5.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/fancyapps/fancybox.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "metafizzy/flickity",
                "version": "2.1.2",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/metafizzy/flickity/archive/v2.1.2.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/metafizzy/flickity.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "iamceege/tooltipster",
                "version": "4.2.6",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/iamceege/tooltipster/archive/4.2.6.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/iamceege/tooltipster.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "fortawesome/fontawesome",
                "version": "5.3.1",
                "type": "drupal-library",
                "dist": {
                    "url": "https://use.fontawesome.com/releases/v5.3.1/fontawesome-free-5.3.1-web.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/FortAwesome/Font-Awesome.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "igorescobar/jquery-mask-plugin",
                "version": "1.14.15",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/igorescobar/jQuery-Mask-Plugin/archive/v1.14.15.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/igorescobar/jQuery-Mask-Plugin.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        },
        {
            "type": "package",
            "package": {
                "name": "woocommerce/flexslider",
                "version": "2.7.1",
                "type": "drupal-library",
                "dist": {
                    "url": "https://github.com/woocommerce/FlexSlider/archive/2.7.1.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/woocommerce/FlexSlider.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],

3. Добавление новых путей установки в корневой composer.json

    "extra": {
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "installer-types": ["drupal-custom-profile"],
        "installer-paths": {
            "web/core": ["type:drupal-core"],
            "web/libraries/{$name}": ["type:drupal-library"],
            "web/modules/contrib/{$name}": ["type:drupal-module"],
            "web/profiles/contrib/{$name}": ["type:drupal-profile"],
            "web/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/{$name}": ["type:drupal-drush"],
            "web/modules/custom/{$name}": ["type:drupal-custom-module"],
            "web/profiles/custom/{$name}": ["type:drupal-custom-profile"],
            "web/themes/custom/{$name}": ["type:drupal-custom-theme"]
        },
        "drupal-scaffold": {
            "initial": {
                ".editorconfig": "../.editorconfig",
                ".gitattributes": "../.gitattributes"
            }
        }
    }	

4. Подключение профиля интернет-магазина в корневой composer.json

Ставим через командную строку:

    composer require oomphinc/composer-installers-extender 
    composer require kvantstudio/site_commerce_profile

5. Запуск установки

Запустите свой сайт в браузере и выполните стандартный процесс установки.

6. Обновление

Запустите команду на обновление. Важно перед обновлением всегда проверяйте актуальность ссылок на репозитории описанные в пункте 2, т.к. могут меняться версии библиотек и добавляться новые.

    composer update    
На нашем сайте filinkov.ru мы используем cookie. Примите нашу Политику использования cookie.
Принимаю