Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
52b2787
OP-291: Update readme
hmfilar Jul 17, 2024
e6dfaba
OP-291: Refactor templates
hmfilar Jul 22, 2024
1984c2d
OP-291: Update dependencies
hmfilar Jul 22, 2024
07a1c60
OP-291: Refactor, simplify processing logic
hmfilar Jul 22, 2024
c545592
OP-291: Use test application build action from SyliusLabs
hmfilar Jul 22, 2024
2d538e5
OP-291: Deprecate WishlistProductFactoryFacade
hmfilar Jul 23, 2024
cd5cc44
OP-291: Refactor AddProductsToCartHandler to handle exceptions in con…
hmfilar Jul 24, 2024
b732a4e
OP-291: Refactor AddSelectedProductsToCartHandler to handle exception…
hmfilar Jul 25, 2024
3db585e
OP-291: Refactor RemoveSelectedProductsFromWishlistHandler to handle …
hmfilar Jul 25, 2024
e156f2d
OP-291: Extract abstraction to prevent code repetition
hmfilar Jul 25, 2024
67e90e1
OP-291: Add a command for removing guest wishlists
hmfilar Jul 25, 2024
6a82668
OP-291: Refactor behats
hmfilar Jul 26, 2024
d53fe47
OP-291: Add tests for the new command
hmfilar Jul 26, 2024
aafb2e1
OP-291: Clean up behat configs
hmfilar Jul 29, 2024
9beaad4
OP-291: Make wishlist page more consistent with cart
hmfilar Jul 29, 2024
be4dc0a
OP-291: Cover edge case with behat tests
hmfilar Jul 30, 2024
516c2bb
OP-291: Replicate wishlist selection logic from product list on produ…
hmfilar Jul 30, 2024
2f48a04
OP-291: Bring back installations steps using recipes and make them op…
hmfilar Jul 30, 2024
167b8f8
OP-291: Include plugin scripts and styles using template events
hmfilar Aug 2, 2024
2808fdf
OP-291: Fix template copying section in readme
hmfilar Aug 28, 2024
aa49117
Merge branch 'master' into feature/op-291-code-style
hmfilar Sep 18, 2024
17d8ab8
OP-291: Update supported php and node versions
hmfilar Sep 18, 2024
6e0c5ac
[Maintenance] Update dependencies
hmfilar Feb 4, 2025
c6ce4ff
[Maintenance] Update service IDs
hmfilar Feb 4, 2025
c835376
[Maintenance] Temporarily comment-out removed classes and interfaces
hmfilar Feb 4, 2025
a58b416
[OP-551] Migrate API Platform configuration to new syntax
hmfilar Feb 4, 2025
322d9c9
[Maintenance] Update routes
hmfilar Feb 4, 2025
dd12f53
[OP-551] Adjust dependencies and a register missing bundle
hmfilar Feb 5, 2025
43d5e89
Merge branch 'master' into feature/op-291-code-style
hmfilar Feb 5, 2025
f69d668
OP-291: Delete resource override, document it
hmfilar Jul 19, 2024
b228236
Merge branch 'MAINTENANCE/sylius-2.0-support' into feature/op-291-cod…
hmfilar Feb 5, 2025
9eb374b
[OP-551] Comment-out event-based template injections
hmfilar Feb 5, 2025
6a4fa0d
[OP-551] Compatibility adjustments
hmfilar Feb 5, 2025
96e60f2
[OP-551] Adjust FE compilation
hmfilar Feb 6, 2025
422ef96
[OP-551] Use twig hooks instead of sylius events
hmfilar Feb 6, 2025
b5672e4
[OP-551] Align templates with the new layout
hmfilar Feb 12, 2025
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
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ "8.1", "8.2", "8.3" ]
symfony: ["^5.4", "^6.4"]
sylius: [ "^1.12", "^1.13" ]
node: [ "18.x", "20.x" ]
php: [ "8.2", "8.3" ]
symfony: ["^6.4", "^7.1"]
sylius: [ "~2.0.0" ]
node: [ "20.x" ]
mysql: ["8.0"]
state_machine_adapter: ["winzou_state_machine", "symfony_workflow"]

Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:

-
name: Upload Behat logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: Behat logs
Expand All @@ -187,7 +187,7 @@ jobs:

-
name: Upload test log logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: Var logs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coding_standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
fail-fast: false
matrix:
php: [ "8.1", "8.2", "8.3" ]
symfony: [ "^5.4", "^6.4" ]
sylius: [ "^1.12", "^1.13" ]
node: [ "18.x", "20.x" ]
symfony: ["^5.4", "^6.4"]
sylius: [ "^2.0" ]
node: [ "20.x" ]

steps:
- uses: actions/checkout@v3
Expand Down
58 changes: 31 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,50 @@
"description": "Wishlist plugin for Sylius.",
"license": "MIT",
"require": {
"php": "^8.1",
"sylius/sylius": "^1.12 || ^1.13",
"symfony/webpack-encore-bundle": "^1.15",
"dompdf/dompdf": "^2.0"
"php": "^8.2",
"sylius/sylius": "^2.0",
"dompdf/dompdf": "^2.0",
"sylius/twig-hooks": "^0.6",
"sylius/twig-extra": "^0.6",
"symfony/ux-autocomplete": "^2.17",
"symfony/ux-live-component": "^2.20",
"symfony/ux-twig-component": "^2.20",
"symfony/stimulus-bundle": "^2.12",
"symfony/webpack-encore-bundle": "^2.1"
},
"require-dev": {
"behat/behat": "^3.7",
"behat/mink-selenium2-driver": "~1.6.0",
"behat/behat": "^3.14",
"behat/mink-selenium2-driver": "^1.7",
"bitbag/coding-standard": "^3.0.0",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"gedmo/doctrine-extensions": "^3.9",
"dmore/behat-chrome-extension": "^1.4",
"friends-of-behat/mink": "^1.8",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-debug-extension": "^2.0",
"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",
"gedmo/doctrine-extensions": "^3.9",
"league/flysystem-bundle": "^3.3",
"nelmio/alice": "^3.10",
"nyholm/psr7": "^1.8",
"phpspec/phpspec": "^7.0",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dotenv": "^5.4 || ^6.0",
"symfony/intl": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"league/flysystem-bundle": "2.4.0",
"sylius/mailer-bundle": "^1.8 || ^2.0@beta",
"sylius/sylius-rector": "^2.0",
"sylius-labs/coding-standard": "^4.4",
"sylius-labs/suite-tags-extension": "~0.2",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/debug-bundle": "^5.4 || ^6.0",
"symfony/dependency-injection": "^6.4 || ^7.1",
"symfony/dotenv": "^6.4 || ^7.1",
"symfony/http-client": "^6.4 || ^7.1",
"symfony/intl": "^6.4 || ^7.1",
"symfony/web-profiler-bundle": "^6.4 || ^7.1",
"lchrusciel/api-test-case": "^4.1 || ^5.0",
"nelmio/alice": "^3.10"
},
"conflict": {
"symfony/symfony": "4.1.8",
"symfony/browser-kit": "4.1.8",
"symfony/dom-crawler": "4.1.8",
"symfony/routing": "4.1.8",
"symfony/doctrine-bridge": "4.4.16",
"symfony/validator": "^6.4.7"
"robertfausk/behat-panther-extension": "^1.1"
},
"prefer-stable": true,
"autoload": {
Expand All @@ -66,7 +69,8 @@
"phpstan/extension-installer": true,
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"symfony/thanks": true
"symfony/thanks": true,
"php-http/discovery": true
},
"preferred-install": {
"sylius/sylius": "source"
Expand Down
93 changes: 63 additions & 30 deletions doc/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
1. *We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.*

```bash
$ composer require bitbag/wishlist-plugin
composer require bitbag/wishlist-plugin
```

2. Add plugin dependencies to your `config/bundles.php` file:
2. (optional) Add plugin dependencies to your `config/bundles.php` file:

```php
// config/bundles.php

Expand All @@ -23,62 +24,94 @@ return [
];
```

3. Import required config in your `config/packages/_sylius.yaml` file:
3. (optional) Import required config in your `config/packages/_sylius.yaml` file:

```yaml
# config/packages/_sylius.yaml

imports:
...

- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/config.yml" }
...
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/config.yml" }
```

4. Import routing in your `config/routes.yaml` file:
4. (optional) Import routing in your `config/routes.yaml` file:

```yaml
```yaml
# config/routes.yaml

bitbag_sylius_wishlist_plugin:
resource: "@BitBagSyliusWishlistPlugin/Resources/config/routing.yml"
```

5. Clear application cache by using command:
5. Override `OrderItemController`

```yaml
sylius_order:
resources:
order_item:
classes:
controller: BitBag\SyliusWishlistPlugin\Controller\OrderItemController

```bash
$ bin/console cache:clear
```

6. Update your database
6. Add plugin templates:

First, please run legacy-versioned migrations by using command:
- Inject blocks:

```bash
$ bin/console doctrine:migrations:migrate
```yaml
sylius_ui:
events:
sylius.shop.layout.header.grid:
blocks:
wishlist_header: '@BitBagSyliusWishlistPlugin/_wishlist_header.html.twig'
sylius.shop.product.index.box:
blocks:
content:
template: "@BitBagSyliusWishlistPlugin/Product/Box/_content.html.twig"
priority: 10
sylius.shop.layout.javascripts:
blocks:
plugin_scripts:
template: "@BitBagSyliusWishlistPlugin/Shop/_scripts.html.twig"
priority: 20
sylius.shop.layout.stylesheets:
blocks:
plugin_stylesheets:
template: "@BitBagSyliusWishlistPlugin/Shop/_styles.html.twig"
priority: 20
sylius.admin.layout.javascripts:
blocks:
plugin_scripts:
template: "@BitBagSyliusWishlistPlugin/Admin/_scripts.html.twig"
priority: 20
sylius.admin.layout.stylesheets:
blocks:
plugin_stylesheets:
template: "@BitBagSyliusWishlistPlugin/Admin/_styles.html.twig"
priority: 20

```

After migration, please create a new diff migration and run it:
- Override templates:

```bash
$ bin/console doctrine:migrations:diff
$ bin/console doctrine:migrations:migrate
mkdir -p templates/bundles/SyliusShopBundle/Product/Show
cp vendor/bitbag/wishlist-plugin/src/Resources/views/Product/Show/_addToCart.html.twig templates/bundles/SyliusShopBundle/Product/Show
```

**Note:** If you are running it on production, add the `-e prod` flag to this command.

**Note:** If you are updating this plugin from version 1.4.x you need to run:
7. Clear application cache by using command:

```bash
$ bin/console doctrine:migrations:version BitBag\\SyliusWishlistPlugin\\Migrations\\Version20201029161558 --add --no-interaction
bin/console cache:clear
```

7. Please add plugin templates into your project:
8. Update your database

```bash
$ cp -R vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/Product templates/bundles/SyliusShopBundle
$ cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_header.html.twig templates/bundles/SyliusShopBundle
$ cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_logo.html.twig templates/bundles/SyliusShopBundle
bin/console doctrine:migrations:migrate
```

8. Add plugin assets to your project
**Note:** If you are running it on production, add the `-e prod` flag to this command.

9. Add plugin assets to your project

We recommend you to use Webpack (Encore), for which we have prepared four different instructions on how to add this plugin's assets to your project:

Expand All @@ -97,7 +130,7 @@ However, if you are not using Webpack, here are instructions on how to add optim
## Asynchronous Messenger case

In case you use asynchronous Messenger transport by default, there is a need to configure all Wishlist commands to sync transport.
You can do this by configuring the `WishlistSyncCommandInterface` interface to sync transport (as presented on code listing below).
You can do this by configuring the `WishlistSyncCommandInterface` interface to sync transport (as presented on code listing below).

```yaml
# config/packages/messenger.yaml
Expand Down
2 changes: 1 addition & 1 deletion doc/01.5-non-webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
1. Install plugin assets using:

```bash
$ bin/console assets:install
bin/console assets:install
```

2. Add twig inclusions in your templates:
Expand Down
8 changes: 4 additions & 4 deletions doc/03-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

Run the below command to see what Symfony services are shared with this plugin:
```bash
$ bin/console debug:container | grep bitbag_sylius_wishlist_plugin
bin/console debug:container | grep bitbag_sylius_wishlist_plugin
```

### List of parameters you can override in your parameters.yml(.dist) file
```bash
$ bin/console debug:container --parameters | grep bitbag
$ bin/console debug:container --parameters | grep wishlist
```
bin/console debug:container --parameters | grep bitbag
bin/console debug:container --parameters | grep wishlist
```
24 changes: 12 additions & 12 deletions doc/04-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
Clone this repository, go to the plugin root directory and run

```bash
$ composer install
$ cd tests/Application
composer install
cd tests/Application
```

If needed, create `.env.local` file with the correct configuration for your environment in the `tests/Application` directory. <br>
Then run the following commands from `tests/Application`:

```bash
$ bin/console doctrine:database:create
$ bin/console doctrine:schema:create
$ bin/console sylius:fixtures:load
$ bin/console assets:install --symlink
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console sylius:fixtures:load
bin/console assets:install --symlink
```

Copy `package.json.~1.xx.dist` file to `package.json` for specific version of Sylius (example for 1.12.0):
```bash
$ cp package.json.\~1.12.dist package.json
cp package.json.\~1.12.dist package.json
```

Then:

```bash
$ yarn install
$ yarn dev
yarn install
yarn dev
```

You're ready to start coding 🎉
Expand All @@ -48,7 +48,7 @@ You're ready to start coding 🎉
To start the development server, from the `tests/Application` directory run:

```bash
$ symfony server:start
symfony server:start
```

and then you should get information about the server address and port (usually http://localhost:8000). <br>
Expand All @@ -60,9 +60,9 @@ If you don't already have Symfony CLI, here's how to install it: https://symfony
To start working on frontend, from the `tests/Application` directory run:

```bash
$ yarn watch
yarn watch
```

It's an infinite process, which will watch your changes in the assets folder and (re)build them. So all of your frontend changes should be done in `{root}/src/Resources/assets` directory. We have configured two independent entry points that should not be combined - `shop` for the storefront and `admin` for the admin panel.

> **⚠ Note**: Before every commit, you should type the `yarn dist` command from the plugin root directory to rebuild dist assets, which are located in `{root}/src/Resources/public`. <br> <br> You also shouldn't add assets to this folder manually because **they will be removed automatically**
> **⚠ Note**: Before every commit, you should type the `yarn dist` command from the plugin root directory to rebuild dist assets, which are located in `{root}/src/Resources/public`. <br> <br> You also shouldn't add assets to this folder manually because **they will be removed automatically**
Loading
Loading