New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DX] Dispatch ui event to allow customize every choice in payment method selection #15384
[DX] Dispatch ui event to allow customize every choice in payment method selection #15384
Conversation
Bunnyshell Preview Environment deletedAvailable commands:
|
@@ -11,5 +11,6 @@ | |||
<p>{{ method.description }}</p> | |||
</div> | |||
{% endif %} | |||
{{ sylius_template_event('sylius.shop.checkout.select_payment.choice_item_content', {'method': method}) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the label and description to a specific template and add it as a block of this new event ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, the way event is added now, it won't work for mollie
, existing snippet with method.description
needs to be extracted into external template and imported back via ui event.
However, this raises a question: should it be done only for payment method choice or for shipping methods and rest of the checkout as well? cc @jakubtobiasz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the label, it would need to pass the form into. I don't think it could be relevant for others event, but maybe i'm wrong.
However, I can extract descritption in that block.
For shipping method, it could be useful too, regarding PickupPoint providers plugin for example, but maybe it should be done in another PR ?
1dca337
to
a67a39d
Compare
a67a39d
to
8099fe1
Compare
…choice in payment method selection
8099fe1
to
5639e58
Compare
@jakubtobiasz Is there anything else i can do here ? |
Thanks, Jibé! 🎉 |
… (Jibbarth, GSadee) This PR was merged into the 1.13 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.13 <!-- see the comment below --> | | Bug fix? | no | | New feature? | yes | | BC breaks? | no | | Deprecations? | no <!-- don't forget to update the UPGRADE-*.md file --> | | Related tickets | N/A | | License | MIT | Following #15384, this add a `sylius.shop.checkout.select_shipping.choice_item_content` and a `sylius.shop.checkout.select_shipping.choice_item_extra` ui events. Description and fee are now extracted and injected through this new events Commits ------- d9e799e [DX][Checkout][ShippingMethod] Dispatch new ui events 0ad2c0f Merge branch '1.13' into feature/ui-event-for-select-shipping
To help PaymentPlugin providers, let's dispatch an ui event inside choice of each payment method. This will allow paymentPlugins to add additionnal field easily without the pain while installing paymentPlugins to copy/paste template that override
SyliusShopBundle/Checkout/SelectPayment/_payment.html.twig
(for example in Mollie) orSyliusShopBundle/Checkout/SelectPayment/_choice.html.twig
(like in Payplug)I targetted 1.13 as it could be considered as a new feature, and paymentPlugins will can start to use it configuring a sylius_ui event block, and still provide template to copy/paste for previous version.
WDYT ?
I'm also wondering if we should merge the GatewayFactory name inside the event name to avoid lot of check on method when creating a new block.