Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
resource: "@GallySyliusPlugin/Resources/config/shop_routing.yml"
prefix: /{_locale}
```
- The plugin uses `symfony/ux-live-component` (facet search/view-more, product & cart recommendations).
Check that the `ux_live_component` route is imported (it should already be there if you
`composer require`d `symfony/ux-live-component` directly at some point, via its Flex recipe; it is
not guaranteed if it only came in transitively through `sylius/sylius`). If `bin/console debug:router
ux_live_component` reports no match, create `config/routes/ux_live_component.yaml`:
```yaml
_live_component:
resource: "@LiveComponentBundle/config/routes.php"
```
- Implement the `Gally\SyliusPlugin\Model\GallyChannelInterface` and `Gally\SyliusPlugin\Model\GallyChannelTrait` in your Channel Entity `src/App/Entity/Channel/Channel.php`.
```php
<?php
Expand All @@ -50,12 +59,7 @@
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`

- **Alternative: install assets via Webpack Encore (recommended for Sylius 2.x)**
- Install assets via Webpack Encore:
- Add the plugin and its JS SDK as npm dependencies in your app's `package.json`:
```json
{
Expand Down Expand Up @@ -97,6 +101,37 @@
```
> The `copyFiles()` call exposes `gally-sdk.global.js` as a standalone IIFE script
> (available as `window.GallySDK`) for use in Twig templates via `{{ asset('build/app/shop/gally/gally-sdk.global.js') }}`.
- Register the plugin's Stimulus controllers in your app's root `assets/controllers.json`:
```json
{
"controllers": {
"@gally/sylius-plugin": {
"range-slider": {
"main": "src/Resources/assets/shop/controllers/RangeSliderController.js",
"enabled": true,
"fetch": "eager"
},
"search-autocomplete": {
"main": "src/Resources/assets/shop/controllers/SearchAutocompleteController.js",
"enabled": true,
"fetch": "eager"
},
"filters-autosubmit": {
"main": "src/Resources/assets/shop/controllers/FiltersAutosubmitController.js",
"enabled": true,
"fetch": "eager"
}
}
}
}
```
> This step is required because `@gally/sylius-plugin` is installed as a local `path` repository
> rather than a real registered npm/Symfony UX package: Symfony Flex normally adds a package's
> Stimulus controllers to your app's `assets/controllers.json` automatically via that package's
> recipe when you run `composer require`, but local `path` packages have no such recipe. This
> entry must therefore mirror the `symfony.controllers` section of the plugin's own `package.json`
> and be kept in sync manually if a future version of the plugin adds, renames, or removes a
> controller.
- Install JS dependencies and build assets:
- **Without Docker** (from the Sylius root directory):
```shell
Expand Down
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
"name": "@gally/sylius-plugin",
"version": "2.3.0",
"license": "OSL-3.0",
"symfony": {
"controllers": {
"range-slider": {
"main": "src/Resources/assets/shop/controllers/RangeSliderController.js",
"enabled": true,
"fetch": "eager"
},
"search-autocomplete": {
"main": "src/Resources/assets/shop/controllers/SearchAutocompleteController.js",
"enabled": true,
"fetch": "eager"
},
"filters-autosubmit": {
"main": "src/Resources/assets/shop/controllers/FiltersAutosubmitController.js",
"enabled": true,
"fetch": "eager"
}
}
},
"peerDependencies": {
"@hotwired/stimulus": "^3.0.0"
},
"dependencies": {
"@elastic-suite/gally-sdk": "2.2.2-alpha.0",
"file-loader": "^6.2.0"
Expand Down
117 changes: 0 additions & 117 deletions src/Controller/Shop/FilterController.php

This file was deleted.

Loading
Loading