Skip to content

Commit

Permalink
refactor #276 [UI] Display refunded part as a sylius ui event in Admi…
Browse files Browse the repository at this point in the history
…n Order Show payment (Jibbarth)

This PR was merged into the 1.5 branch.

Discussion
----------

This follow up Sylius/Sylius#13817

| Q               | A
| --------------- | -----
| Branch?         | 1.5 (bug fixes, improvements)
| Bug fix?        | no/yes
| New feature?    | no/yes
| Related tickets | fixes #X, partially #Y, mentioned in #Z

This part of the template should be added via Sylius Ui Event, and it will allow to remove this template in Sylius-Standard, to be able to have the refund button removed when installing https://github.com/Sylius/RefundPlugin 

A PR on sylius standard will follow


Commits
-------

a58ab1e [UI] Display refunded part as a sylius ui event in Admin Order Show payment
25c604e Use constant for payment state
1cd0fa0 Change pay_pal_refunded_message block priority
  • Loading branch information
GSadee authored Oct 6, 2023
2 parents 8b1be96 + 1cd0fa0 commit fbf7c92
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 46 deletions.
5 changes: 5 additions & 0 deletions src/Resources/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ sylius_ui:
pay_pal_payment_method:
template: '@SyliusPayPalPlugin/javascripts.html.twig'
priority: -100
sylius.admin.order.show.payment_content:
blocks:
pay_pal_refunded_message:
template: '@SyliusPayPalPlugin/Admin/Order/Show/Payment/_refundedPayPal.html.twig'
priority: 7 # After "refund_transition" block.

monolog:
channels: ['paypal']
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% if
payment.method.gatewayConfig.factoryName == 'sylius.pay_pal' and
payment.state == constant('Sylius\\Component\\Core\\Model\\PaymentInterface::STATE_REFUNDED')
%}
<div class="ui icon mini message">
<i class="paypal icon"></i>
<div class="content">
<p>{{ 'sylius.pay_pal.tender_type'|trans }}</p>
</div>
</div>
{% endif %}

This file was deleted.

0 comments on commit fbf7c92

Please sign in to comment.