Skip to content

Commit 5487035

Browse files
authored
Merge pull request #168 from synolia/fix/retry-page-hooks
[SelectPayment] Unify display
2 parents 951499a + 11516e5 commit 5487035

5 files changed

Lines changed: 15 additions & 19 deletions

File tree

config/twig_hooks/shop.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,31 @@ sylius_twig_hooks:
2020
template: "@PayPlugSyliusPayPlugPlugin/Account/SavedCards/Index/_subcontent.html.twig"
2121
priority: 10
2222

23+
2324
# TODO: check if this is possible only on select_payment page
2425
'sylius_shop.checkout#stylesheets':
2526
select_payment_css:
2627
template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig'
2728

29+
'sylius_shop.order#stylesheets':
30+
select_payment_css:
31+
template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig'
32+
2833
'sylius_shop.shared.form.select_payment.payment.choice.details':
2934
payplug_choice:
3035
template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig'
31-
32-
'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug':
36+
'sylius_shop.shared.form.select_payment.payment.choice.details#payplug':
3337
payplug_block:
3438
template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_block.html.twig'
35-
'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_oney':
39+
'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_oney':
3640
payplug_oney_block:
3741
template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_oney_block.html.twig'
38-
'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_bancontact':
42+
'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_bancontact':
3943
payplug_bancontact_block:
4044
template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_bancontact_block.html.twig'
41-
'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_apple_pay':
45+
'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_apple_pay':
4246
payplug_apple_pay_block:
4347
template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_apple_pay_block.html.twig'
44-
'sylius_shop.checkout.select_payment.content.form.select_payment.payment.choice.details#payplug_american_express':
48+
'sylius_shop.shared.form.select_payment.payment.choice.details#payplug_american_express':
4549
payplug_american_express_block:
4650
template: '@PayPlugSyliusPayPlugPlugin/SyliusShopBundle/Checkout/SelectPayment/_payplug_american_express_block.html.twig'

src/Form/Extension/PaymentTypeExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function buildForm(
4141
$builder
4242
->add('oney_payment_choice', ChoiceType::class, [
4343
'mapped' => false,
44+
'block_prefix' => 'oney_payment_choice',
4445
'choices' => $this->oneySupportedPaymentChoiceProvider->getSupportedPaymentChoices(true),
4546
])
4647
->add('payplug_card_choice', TextType::class, [

templates/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,5 @@
99
{% set applePayFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\ApplePayGatewayFactory::FACTORY_NAME') %}
1010
{% set americanExpressFactoryName = constant('PayPlug\\SyliusPayPlugPlugin\\Gateway\\AmericanExpressGatewayFactory::FACTORY_NAME') %}
1111

12-
{% if factoryName == oneyFactoryName %}
13-
{% hook '#payplug_oney' %}
14-
{% elseif factoryName == payplugFactoryName %}
15-
{% hook '#payplug' %}
16-
{% elseif factoryName == bancontactFactoryName %}
17-
{% hook '#payplug_bancontact' %}
18-
{% elseif factoryName == applePayFactoryName %}
19-
{% hook '#payplug_apple_pay' %}
20-
{% elseif factoryName == americanExpressFactoryName %}
21-
{% hook '#payplug_american_express' %}
22-
{% endif %}
12+
{% hook '#' ~ factoryName %}
13+

templates/form/integrated.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
{% endif %}
9393

9494
<div class="payplugIntegratedPayment__container">
95-
<button id="paid" class="ui large primary button" type="button">
95+
<button id="paid" class="btn btn-primary" type="button">
9696
{{ 'payplug_sylius_payplug_plugin.ui.integrated_payment.place_order.label'|trans }}
9797
</button>
9898
</div>

templates/form/sylius_checkout_select_payment_row.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% block _sylius_shop_checkout_select_payment_payments_entry_oney_payment_choice_row %}
1+
{% block oney_payment_choice_row %}
22
{% set data = oney_simulation_data() %}
33
{% import "@SyliusShop/shared/macro/money.html.twig" as money %}
44

0 commit comments

Comments
 (0)