gally / sylius-plugin
Sylius connector for Gally
Package info
github.com/Elastic-Suite/gally-sylius-connector
Type:sylius-plugin
pkg:composer/gally/sylius-plugin
Requires
- php: ^8.0
- gally/gally-php-sdk: 2.2.1
- sylius/grid-bundle: ^1.14.1
- sylius/sylius: ^2.0
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- friendsofphp/php-cs-fixer: ~3.56.0
- phpspec/phpspec: ^7.2
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.8.1
- phpstan/phpstan-doctrine: 1.3.37
- phpstan/phpstan-strict-rules: ^1.3.0
- phpstan/phpstan-webmozart-assert: ^1.2.0
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sylius-labs/coding-standard: ^4.2
- symfony/browser-kit: ^6.4 || ^7.1
- symfony/debug-bundle: ^6.4 || ^7.1
- symfony/dotenv: ^6.4 || ^7.1
- symfony/flex: ^2.2.2
- symfony/intl: ^6.4 || ^7.1
- symfony/web-profiler-bundle: ^6.4 || ^7.1
- vimeo/psalm: 6.10.3
Conflicts
- symfony/framework-bundle: 6.2.8
This package is auto-updated.
Last update: 2026-06-16 17:19:25 UTC
README
Requirements
- Gally version: 2.1.x
- Sylius version: 2.0.x
Usage
- Install the
gally/sylius-pluginbundle- Run
composer require gally/sylius-plugin - Add the bundle in
config/bundles.php. You must put it afterSyliusGridBundle[...] Gally\SyliusPlugin\GallySyliusPlugin::class => ['all' => true],
- Import the Gally Sylius bundle configuration by adding the following lines to the imports section of
config/packages/_sylius.yaml- { resource: "@GallySyliusPlugin/Resources/config/config.yml" } - Import admin routes by creating a file
config/routes/gally_admin.yamlgally_admin: resource: "@GallySyliusPlugin/Resources/config/admin_routing.yml" prefix: /admin
- Import shop routes by creating a file
config/routes/gally_shop.yamlgally_shop: resource: "@GallySyliusPlugin/Resources/config/shop_routing.yml" prefix: /{_locale}
- Implement the
Gally\SyliusPlugin\Model\GallyChannelInterfaceandGally\SyliusPlugin\Model\GallyChannelTraitin your Channel Entitysrc/App/Entity/Channel/Channel.php.
<?php declare(strict_types=1); namespace App\Entity\Channel; use Doctrine\ORM\Mapping as ORM; use Gally\SyliusPlugin\Model\GallyChannelInterface; use Gally\SyliusPlugin\Model\GallyChannelTrait; use Sylius\Component\Core\Model\Channel as BaseChannel; #[ORM\Entity] #[ORM\Table(name: 'sylius_channel')] class Channel extends BaseChannel implements GallyChannelInterface { use GallyChannelTrait; }
-
Copy the bundle assets (Javascript & CSS files):
- Run
php bin/console assets:install - Run
php bin/console sylius:install:assets - Run
php bin/console sylius:theme:assets:install
- Run
-
Alternative: install assets via Webpack Encore (recommended for Sylius 2.x)
- Add the plugin and its JS SDK as npm dependencies in your app's
package.json:{ "dependencies": { "@gally/sylius-plugin": "link:vendor/gally/sylius-plugin", "@elastic-suite/gally-sdk": "2.2.2-alpha.0" } }Why
link:instead offile:?
Yarn v1 has a known bug withfile:local packages that declare their own npm dependencies (such as@elastic-suite/gally-sdk): it tries to scan anode_modulesfolder inside its cache copy of the package, which does not exist, causing anEACCES/ENOENTerror.
Usinglink:creates a simple symlink tovendor/gally/sylius-pluginwithout going through the cache.@elastic-suite/gally-sdkmust then be declared explicitly at the root level so that webpack can resolve it.Development only: if you are working on the plugin sources directly (i.e. pointing to
link:packages/GallyPlugininstead oflink:vendor/gally/sylius-plugin), you must also add apostinstallscript to build the@elastic-suite/gally-sdkdist files, which are not pre-compiled on the GitHub branch:{ "scripts": { "postinstall": "cd node_modules/@elastic-suite/gally-sdk && yarn install" } } - Add the Gally shop entry point and the SDK IIFE copy in your app's
webpack.config.js:Encore // ... your existing shop config .addEntry('gally-shop-entry', './vendor/gally/sylius-plugin/src/Resources/assets/shop/entrypoint.js') .copyFiles({ from: './node_modules/@elastic-suite/gally-sdk/dist/browser/iife', to: 'gally/[name].[ext]', pattern: /gally-sdk\.global\.js/, }) ;
The
copyFiles()call exposesgally-sdk.global.jsas a standalone IIFE script (available aswindow.GallySDK) for use in Twig templates via{{ asset('build/app/shop/gally/gally-sdk.global.js') }}. - Install JS dependencies and build assets:
- Without Docker (from the Sylius root directory):
yarn install yarn build
- With Docker (via the
nodejscontainer):docker compose run --rm nodejs
The
nodejscontainer automatically runsyarn install && yarn buildand mounts the project into/srv/sylius.
- Without Docker (from the Sylius root directory):
- Add the plugin and its JS SDK as npm dependencies in your app's
-
Run
php bin/console doctrine:migrations:migrateto update the database schema -
Open Sylius Admin, head to Configuration > Gally and configure the Gally endpoint (URL, credentials), after that enable Gally on your channel (Configuration > Channel > Edit)
- Run
- Run this commands from your Sylius instance. This commands must be runned only once to synchronize the structure.
bin/console gally:structure:sync # Sync catalog et source field data with gally - Run a full index from Sylius to Gally. This command can be run only once. Afterwards, the modified products are automatically synchronized.
bin/console gally:index # Index category and product entity to gally - At this step, you should be able to see your product and source field in the Gally backend.
- They should also appear in your Sylius frontend when searching or browsing categories.
- And you're done !
- You can also run the command to clean data that are not present in sylius anymore:
bin/console gally:structure:clean
noUiSlider
This bundle includes the noUiSlider distribution files. noUiSlider is "a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support" which is used in this project for the price slider implementation.