From 8099fe134af7af350802a2458583eec8a4ebda6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jib=C3=A9=20Barth?= Date: Mon, 2 Oct 2023 13:14:48 +0200 Subject: [PATCH] [Checkout][PaymentMethod] Extract description and inject it via the new event --- src/Sylius/Bundle/ShopBundle/Resources/config/app/config.yml | 5 +++++ .../Resources/views/Checkout/SelectPayment/_choice.html.twig | 5 ----- .../views/Checkout/SelectPayment/_description.html.twig | 5 +++++ 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_description.html.twig diff --git a/src/Sylius/Bundle/ShopBundle/Resources/config/app/config.yml b/src/Sylius/Bundle/ShopBundle/Resources/config/app/config.yml index 8bd89a2c9af2..e64372c87813 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/config/app/config.yml +++ b/src/Sylius/Bundle/ShopBundle/Resources/config/app/config.yml @@ -1036,6 +1036,11 @@ sylius_ui: context: event: sylius.shop.checkout.select_shipping.before_navigation + sylius.shop.checkout.select_payment.choice_item_content: + blocks: + description: + template: "@SyliusShop/Checkout/SelectPayment/_description.html.twig" + sylius.shop.product.show.left_sidebar: blocks: before_legacy: diff --git a/src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_choice.html.twig b/src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_choice.html.twig index 70479dd8d2a5..758c528fb776 100644 --- a/src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_choice.html.twig +++ b/src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_choice.html.twig @@ -6,11 +6,6 @@
{{ form_label(form, null, {'label_attr': {'data-test-payment-method-label': ''}}) }} - {% if method.description is not null %} -
-

{{ method.description }}

-
- {% endif %} {{ sylius_template_event('sylius.shop.checkout.select_payment.choice_item_content', {'method': method}) }}
diff --git a/src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_description.html.twig b/src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_description.html.twig new file mode 100644 index 000000000000..956ce3dbd70f --- /dev/null +++ b/src/Sylius/Bundle/ShopBundle/Resources/views/Checkout/SelectPayment/_description.html.twig @@ -0,0 +1,5 @@ +{% if method.description is not null %} +
+

{{ method.description }}

+
+{% endif %}