diff --git a/config/twig_hooks/shop.yaml b/config/twig_hooks/shop.yaml
index 83dd4c17..8fe96660 100644
--- a/config/twig_hooks/shop.yaml
+++ b/config/twig_hooks/shop.yaml
@@ -7,4 +7,15 @@ sylius_twig_hooks:
'sylius_shop.cart.index.content.form.sections.general#right':
pay_with_oney:
template: '@PayPlugSyliusPayPlugPlugin/oney/cart/pay_with_oney.html.twig'
- priority: 1
\ No newline at end of file
+ priority: 1
+ 'sylius_shop.account.saved_card#stylesheets':
+ payplug_styles:
+ template: '@PayPlugSyliusPayPlugPlugin/stylesheets/saved_cards.html.twig'
+ priority: 1
+ 'sylius.shop.account.saved_cards.index.subcontent':
+ header:
+ template: '@PayPlugSyliusPayPlugPlugin/Account/SavedCards/Index/_header.html.twig'
+ priority: 20
+ subcontent:
+ template: "@PayPlugSyliusPayPlugPlugin/Account/SavedCards/Index/_subcontent.html.twig"
+ priority: 10
diff --git a/config/ui.yaml b/config/ui.yaml
index 720d44d5..8f25bae9 100644
--- a/config/ui.yaml
+++ b/config/ui.yaml
@@ -21,34 +21,6 @@ sylius_ui:
blocks:
oney_common:
template: '@PayPlugSyliusPayPlugPlugin/stylesheets/oney_common.html.twig'
- sylius.shop.account.saved_cards.index.header.content:
- blocks:
- legacy:
- template: "@SyliusUi/Block/_legacySonataEvent.html.twig"
- context:
- event: sylius.shop.account.saved_cards.index.header
- sylius.shop.account.saved_cards.layout.stylesheets:
- blocks:
- saved_cards:
- template: '@PayPlugSyliusPayPlugPlugin/stylesheets/saved_cards.html.twig'
- sylius.shop.account.saved_cards.index.subcontent:
- blocks:
- header:
- template: '@SyliusShop/Account/SavedCards/Index/_header.html.twig'
- priority: 20
- after_content_header_legacy:
- template: "@SyliusUi/Block/_legacySonataEvent.html.twig"
- priority: 15
- context:
- event: sylius.shop.account.order.index.after_content_header
- subcontent:
- template: "@SyliusShop/Account/SavedCards/Index/_subcontent.html.twig"
- priority: 10
- after_grid_legacy:
- template: "@SyliusUi/Block/_legacySonataEvent.html.twig"
- priority: 5
- context:
- event: sylius.shop.account.order.index.after_grid
sylius.admin.payment_method.create.stylesheets: &cssEvt
blocks:
payment_methods_css:
@@ -60,4 +32,4 @@ sylius_ui:
template: '@PayPlugSyliusPayPlugPlugin/stylesheets/select_payment_css.html.twig'
select_payment_js:
template: '@PayPlugSyliusPayPlugPlugin/javascripts/select_payment_js.html.twig'
- sylius.shop.order.select_payment.before_form: *selectPayment
\ No newline at end of file
+ sylius.shop.order.select_payment.before_form: *selectPayment
diff --git a/src/EventListener/AccountMenuListener.php b/src/EventListener/AccountMenuListener.php
index 9bc1cdbb..e563bf1c 100644
--- a/src/EventListener/AccountMenuListener.php
+++ b/src/EventListener/AccountMenuListener.php
@@ -19,7 +19,7 @@ public function addAccountMenuItems(MenuBuilderEvent $event): void
])
->setAttribute('type', 'link')
->setLabel('payplug_sylius_payplug_plugin.ui.account.saved_cards.title')
- ->setLabelAttribute('icon', 'credit card')
+ ->setLabelAttribute('icon', 'tabler:credit-card')
;
}
}
diff --git a/templates/Account/SavedCards/Index/_header.html.twig b/templates/Account/SavedCards/Index/_header.html.twig
new file mode 100644
index 00000000..0449e017
--- /dev/null
+++ b/templates/Account/SavedCards/Index/_header.html.twig
@@ -0,0 +1,4 @@
+
+
diff --git a/templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig b/templates/Account/SavedCards/Index/_subcontent.html.twig
similarity index 94%
rename from templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig
rename to templates/Account/SavedCards/Index/_subcontent.html.twig
index e3fdf002..d3569426 100644
--- a/templates/SyliusShopBundle/Account/SavedCards/Index/_subcontent.html.twig
+++ b/templates/Account/SavedCards/Index/_subcontent.html.twig
@@ -1,5 +1,6 @@
-{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
-{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
+{% import '@SyliusShop/shared/buttons.html.twig' as buttons %}
+{% import '@SyliusShop/shared/messages.html.twig' as messages %}
+{% set savedCards = get_hookable_context().savedCards %}
diff --git a/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig b/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig
deleted file mode 100644
index f9f75099..00000000
--- a/templates/SyliusShopBundle/Account/SavedCards/Index/_header.html.twig
+++ /dev/null
@@ -1,6 +0,0 @@
-
\ No newline at end of file
diff --git a/templates/card/index.html.twig b/templates/card/index.html.twig
index 68614718..0cb79c26 100644
--- a/templates/card/index.html.twig
+++ b/templates/card/index.html.twig
@@ -1,10 +1,10 @@
{% extends '@PayPlugSyliusPayPlugPlugin/card/layout.html.twig' %}
-{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
-{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
+{% import '@SyliusShop/shared/messages.html.twig' as messages %}
+{% import '@SyliusShop/shared/buttons.html.twig' as buttons %}
{% block title %}{{ 'payplug_sylius_payplug_plugin.ui.account.saved_cards.title'|trans }} | {{ parent() }}{% endblock %}
{% block subcontent %}
- {{ sylius_template_event('sylius.shop.account.saved_cards.index.subcontent', {'savedCards': savedCards}) }}
+ {% hook 'sylius.shop.account.saved_cards.index.subcontent' with { _prefixes: [], savedCards: savedCards } %}
{% endblock %}
diff --git a/templates/card/layout.html.twig b/templates/card/layout.html.twig
index fc9f4bf4..190d26e9 100644
--- a/templates/card/layout.html.twig
+++ b/templates/card/layout.html.twig
@@ -1,32 +1,29 @@
-{% extends '@SyliusShop/Account/layout.html.twig' %}
+{% extends '@SyliusShop/account/common/index.html.twig' %}
-{% block stylesheets %}
- {{ parent() }}
- {{ sylius_template_event('sylius.shop.account.saved_cards.layout.stylesheets') }}
-{% endblock %}
+{% set prefixes = ['sylius_shop.account.saved_card'] %}
+{% from '@SyliusShop/shared/breadcrumbs.html.twig' import breadcrumbs as breadcrumbs %}
{% block content %}
- {% block breadcrumb %}
-
- {% endblock %}
-
-
-
- {{ sylius_template_event('sylius.shop.account.layout.menu') }}
-
-
- {{ sylius_template_event('sylius.shop.account.layout.before_subcontent') }}
-
- {% block subcontent %}
+
+
+ {% block breadcrumb %}
+
+ {{ breadcrumbs([
+ { label: 'sylius.ui.home'|trans, path: path('sylius_shop_homepage')},
+ { label: 'sylius.ui.my_account'|trans, path: path('sylius_shop_account_dashboard')},
+ { label: 'payplug_sylius_payplug_plugin.ui.account.saved_cards.title'|trans, active: true}
+ ]) }}
+
{% endblock %}
- {{ sylius_template_event('sylius.shop.account.layout.after_subcontent') }}
+
+ {% hook 'sylius_shop.account.common.index.content.menu' %}
+
+
+
+ {% block subcontent %}
+ {% endblock %}
+
{% endblock %}
diff --git a/templates/stylesheets/saved_cards.html.twig b/templates/stylesheets/saved_cards.html.twig
index f027c015..19671027 100644
--- a/templates/stylesheets/saved_cards.html.twig
+++ b/templates/stylesheets/saved_cards.html.twig
@@ -1 +1 @@
-{% include '@SyliusUi/_stylesheets.html.twig' with {'path': 'bundles/payplugsyliuspayplugplugin/assets/shop/account/index.css'} %}
\ No newline at end of file
+