How to replace text in Jms Payment Paypal Bundle

517 views Asked by At

I have the paypal bundle working in JMS Core Payment (symfony2). However, in the checkout I have the text:

Data paypal express checkout

I have done a site wide search for this and can not find this text anywhere. No answers on Google too!

Anyone have an idea how to translate this or even delete it?

2

There are 2 answers

0
OlliM On

You can hide it using this code:

{{ form_row(form.data_paypal_express_checkout, {'label': ' ', 'label_attr': {'class': 'hide'}}) }}

and add own messages using this translation key:

form.label.paypal_express_checkout
0
Manolo On

You can use form theming. As described here, add a theme file:

{# src/AppBundle/Resources/views/Orders/theme.html.twig #}

{% extends 'form_div_layout.html.twig' %}

and reference it from the template where the form is rendered:

{# src/AppBundle/Resources/views/Orders/show.html.twig #}

{% form_theme form 'AppBundle:Orders:theme.html.twig' %}

{{ form_start(form) }}
    {{ form_widget(form) }}
    <input type="submit" value="Pay € {{ order.amount }}" />
{{ form_end(form) }}

Then, add the "jms_choose_payment_method_data_paypal_express_checkout" label field with no content in the theme file:

{% block _jms_choose_payment_method_data_paypal_express_checkout_label %}
{% endblock %}

And you're done.