Skip to content
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

Checkout process templates missing #2

Open
ZZromanZZ opened this issue Mar 22, 2019 · 3 comments
Open

Checkout process templates missing #2

ZZromanZZ opened this issue Mar 22, 2019 · 3 comments

Comments

@ZZromanZZ
Copy link

It would be nice to have frontend checkout templates that has payment fee support.

@bondie
Copy link

bondie commented Nov 7, 2019

@ZZromanZZ did you solved it? Could you share with us please?

@ZZromanZZ
Copy link
Author

ZZromanZZ commented Nov 7, 2019

In the end, my frontend is very different from Sylius default template, so I didn't have to. However at least for frontend demo purposes, it would nice to have.

@sabat24
Copy link

sabat24 commented May 5, 2022

You need to customize the block responsible for generating label for payment method. You can do it by creating your own theme and applying it into the twig file responsible for displaying checkout form. In my case the block name is _checkout_form_payments_entry_method_entry_label so it may differs from yours, because it depends on fields and form names.

{% extends '@SyliusShop/Form/theme.html.twig' %}

{% block _checkout_form_payments_entry_method_entry_label %}
    {% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
    {% set label = form.vars.label %}

    {% set payment_cost = form.parent.vars.payment_costs[form.vars.value] %}
    {% if payment_cost > 0 %}
        {% set label = label ~ ' (+' ~ money.convertAndFormat(payment_cost) ~ ')' %}
    {% endif %}

    {{- form_label(form, label) -}}
{% endblock %}

obraz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants