diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e57fc291..2c50179f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,30 +16,20 @@ jobs: tests: runs-on: ubuntu-latest - name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" + name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" strategy: fail-fast: false matrix: php: [ "8.3" ] symfony: [ "^6.4", "^7.1" ] - sylius: [ "^2.0" ] + sylius: [ "^2.0.7" ] node: [ "20.x" ] mysql: [ "8.4" ] - state_machine_adapter: ["symfony_workflow"] - - include: - - php: "8.3" - symfony: "^7.1" - sylius: "^2.0" - mysql: "8.4" - node: "20.x" - state_machine_adapter: "winzou_state_machine" env: APP_ENV: test DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" - TEST_SYLIUS_STATE_MACHINE_ADAPTER: "${{ matrix.state_machine_adapter }}" steps: - @@ -115,13 +105,6 @@ jobs: if: matrix.sylius != '' run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction - - - name: Require Winzou State Machine - if: "${{ matrix.state_machine_adapter == 'winzou_state_machine' }}" - run: | - composer require winzou/state-machine:^0.4 --no-update - composer require winzou/state-machine-bundle:^0.6 --no-update - - name: Install PHP dependencies run: composer install --no-interaction @@ -197,7 +180,7 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: "Behat logs - Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" + name: "Behat logs - Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" path: etc/build/ if-no-files-found: ignore @@ -206,6 +189,6 @@ jobs: uses: actions/upload-artifact@v4 if: failure() with: - name: "Var logs - Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" + name: "Var logs - Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" path: tests/Application/var/log/ if-no-files-found: ignore diff --git a/composer.json b/composer.json index 390e8d6f..83e9385d 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "require": { "php": "^8.2", - "sylius/sylius": "^2.0", + "sylius/sylius": "^2.0.7", "dompdf/dompdf": "^2.0" }, "require-dev": { diff --git a/config/config.yaml b/config/config.yaml index af18623c..ec65e7da 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,2 +1,2 @@ imports: - - { resource: "@SyliusWishlistPlugin/config/app/twig_hooks/**/*.yaml" } + - { resource: "@SyliusWishlistPlugin/config/twig_hooks/**/*.yaml" } diff --git a/config/app/twig_hooks/base.yaml b/config/twig_hooks/base.yaml similarity index 100% rename from config/app/twig_hooks/base.yaml rename to config/twig_hooks/base.yaml diff --git a/config/twig_hooks/product/card.yaml b/config/twig_hooks/product/card.yaml new file mode 100644 index 00000000..998e5e82 --- /dev/null +++ b/config/twig_hooks/product/card.yaml @@ -0,0 +1,6 @@ +sylius_twig_hooks: + hooks: + 'sylius_shop.shared.product.card': + add_to_wishlist: + template: "@SyliusWishlistPlugin/common/add_to_wishlist.html.twig" + priority: -100 diff --git a/config/app/twig_hooks/product/show.yaml b/config/twig_hooks/product/show.yaml similarity index 100% rename from config/app/twig_hooks/product/show.yaml rename to config/twig_hooks/product/show.yaml diff --git a/templates/common/add_to_wishlist.html.twig b/templates/common/add_to_wishlist.html.twig index eebbaed9..48924207 100644 --- a/templates/common/add_to_wishlist.html.twig +++ b/templates/common/add_to_wishlist.html.twig @@ -1,14 +1,15 @@ +{% set product = hookable_metadata.context.product %} {% set isUser = app.user is not null %} {% set wishlists = isUser ? findAllByShopUserAndToken(app.user) : findAllByAnonymousAndChannel(sylius.channel) %} {% set is_single_wishlist = wishlists|length < 2 %} -