Skip to content
Merged
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
25 changes: 4 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
-
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
imports:
- { resource: "@SyliusWishlistPlugin/config/app/twig_hooks/**/*.yaml" }
- { resource: "@SyliusWishlistPlugin/config/twig_hooks/**/*.yaml" }
File renamed without changes.
6 changes: 6 additions & 0 deletions config/twig_hooks/product/card.yaml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 13 additions & 12 deletions templates/common/add_to_wishlist.html.twig
Original file line number Diff line number Diff line change
@@ -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 %}

<div class="mb-3">
<div class="mt-3">
{% if is_single_wishlist %}
<a
href="{{ path('sylius_wishlist_plugin_shop_locale_wishlist_add_product', {'productId': product.id}) }}"
class="btn btn-icon btn-outline-secondary w-100"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
href="{{ path('sylius_wishlist_plugin_shop_locale_wishlist_add_product', {'productId': product.id}) }}"
class="btn btn-icon btn-outline-secondary w-100"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
>
{{ ux_icon('mdi:heart', {'class': 'icon icon-sm'}) }}
{{ 'sylius_wishlist_plugin.ui.add_to_wishlist'|trans }}
Expand All @@ -23,13 +24,13 @@
{% for wishlist in wishlists %}
<li>
<a
href="{{ path('sylius_wishlist_plugin_shop_locale_wishlist_add_product_to_selected_wishlist', {
'wishlistId': wishlist.id,
'productId': product.id
}) }}"
class="dropdown-item"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
href="{{ path('sylius_wishlist_plugin_shop_locale_wishlist_add_product_to_selected_wishlist', {
'wishlistId': wishlist.id,
'productId': product.id
}) }}"
class="dropdown-item"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
>
<span>{{ wishlist.name }}</span>
</a>
Expand Down

This file was deleted.

Loading