Page 1 of 1
Amend the list of payment options on Checkout
Posted: Wed Jun 05, 2019 3:34 pm
by rpmb
Version 3.0.2.0
I have just enabled Paypal Express and have the button displayed on the cart and checkout pages. However, paypal express is also listed as a payment option when you reach the checkout in the payment methods radio selection which kinda defeats the point of having the button displayed.
Is it possible to remove it?
I think this would be an amendment in the controller/checkout/payment_method.php file? just not 100% sure how I would implement it.
Re: Amend the list of payment options on Checkout
Posted: Wed Jun 05, 2019 5:59 pm
by paulfeakins
rpmb wrote: ↑Wed Jun 05, 2019 3:34 pm
Is it possible to remove it?
Why give customers less choice of what method to use?
It's been shown that more payment methods = more sales.
Re: Amend the list of payment options on Checkout
Posted: Wed Jun 05, 2019 6:14 pm
by rpmb
Its not removing the option. The option is there by way of the paypal express button which the customer should use to checkout with if they wish to use that option.
What I am looking to achieve is removal of the duplicate listing as a payment option.
This is how it looks at the moment
Paymentsense
Paypal express checkout
Paypal
Bank transfer
Paypal express button
Doesnt make any sense to have it listed twice.
Re: Amend the list of payment options on Checkout
Posted: Wed Jun 05, 2019 6:20 pm
by paulfeakins
Hmm true. The code loops over all the enabled payment methods, you might have to add some nasty hack to check for that one and not display just that one ...
Re: Amend the list of payment options on Checkout
Posted: Wed Jun 05, 2019 6:22 pm
by rpmb
lol well i prefer cheeky hack
Re: Amend the list of payment options on Checkout
Posted: Thu Jun 06, 2019 7:23 pm
by paulfeakins
rpmb wrote: ↑Wed Jun 05, 2019 6:22 pm
lol well i prefer cheeky hack
Haha well, it can be the only way on rare occasions!
Re: Amend the list of payment options on Checkout
Posted: Thu Jun 06, 2019 11:44 pm
by rpmb
Actually, I am wondering if this cheeky little hack could be achieved in Twig.
{% if payment_methods %}
<p>{{ text_payment_method }}</p>
{% for payment_method in payment_methods %}
<div class="radio">
<label>{% if payment_method.code == code or not code %}
{% set code = payment_method.code %}
<input type="radio" name="payment_method" value="{{ payment_method.code }}" checked="checked" />
{% else %}
<input type="radio" name="payment_method" value="{{ payment_method.code }}" />
{% endif %}
{{ payment_method.title }}
{% if payment_method.terms %}
({{ payment_method.terms }})
{% endif %} </label>
</div>
{% endfor %}
{% endif %}
Is the code in question. I am a Twig novice but looking at what you can do with it wouldn't something like
{% if payment_method.code == pp_express %}
<input type="hidden"...
So hiding the payment option from the radio list.
Re: Amend the list of payment options on Checkout
Posted: Fri Jun 07, 2019 5:38 pm
by paulfeakins
rpmb wrote: ↑Thu Jun 06, 2019 11:44 pm
Actually, I am wondering if this cheeky little hack could be achieved in Twig.
One way to find out ...
Re: Amend the list of payment options on Checkout
Posted: Sat Jun 08, 2019 1:37 am
by rpmb
That would be a no for TWIG. Well, not any way I know to try it.
I did manage to do this in my one-page checkout in the payment method by checking in the payment method routine for pp_express and then basically telling it to skip that and load the rest.
Re: Amend the list of payment options on Checkout
Posted: Sat Jun 08, 2019 1:15 pm
by letxobnav
you can check in the config for "module_pp_button_status" = 1, then the button extension is enabled.
Re: Amend the list of payment options on Checkout
Posted: Sat Jun 08, 2019 2:58 pm
by rpmb
Yes, you can. But not what I was looking for checking the button status would not remove the duplicate listing.
Re: Amend the list of payment options on Checkout
Posted: Sun Jun 09, 2019 10:27 am
by letxobnav
well, I do not know how that button is supposed to work and why it is a separate module but you could disable pp express based on that condition.
Not sure what that would do to your quotes in cart though.
Code: Select all
if ($this->config->get('module_pp_button_status')) {
$status = false;
}