Post by rpmb » Wed Jun 05, 2019 3:34 pm

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.

opencart 3.0.2.0


User avatar
New member

Posts

Joined
Wed Jun 30, 2010 9:13 pm
Location - Cornwall

Post by paulfeakins » Wed Jun 05, 2019 5:59 pm

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.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by rpmb » Wed Jun 05, 2019 6:14 pm

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.

opencart 3.0.2.0


User avatar
New member

Posts

Joined
Wed Jun 30, 2010 9:13 pm
Location - Cornwall

Post by paulfeakins » Wed Jun 05, 2019 6:20 pm

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 ...

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by rpmb » Wed Jun 05, 2019 6:22 pm

lol well i prefer cheeky hack

opencart 3.0.2.0


User avatar
New member

Posts

Joined
Wed Jun 30, 2010 9:13 pm
Location - Cornwall

Post by paulfeakins » Thu Jun 06, 2019 7:23 pm

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!

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by rpmb » Thu Jun 06, 2019 11:44 pm

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.

opencart 3.0.2.0


User avatar
New member

Posts

Joined
Wed Jun 30, 2010 9:13 pm
Location - Cornwall

Post by paulfeakins » Fri Jun 07, 2019 5:38 pm

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 ...

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by rpmb » Sat Jun 08, 2019 1:37 am

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.

opencart 3.0.2.0


User avatar
New member

Posts

Joined
Wed Jun 30, 2010 9:13 pm
Location - Cornwall

Post by letxobnav » Sat Jun 08, 2019 1:15 pm

you can check in the config for "module_pp_button_status" = 1, then the button extension is enabled.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by rpmb » Sat Jun 08, 2019 2:58 pm

Yes, you can. But not what I was looking for checking the button status would not remove the duplicate listing.

opencart 3.0.2.0


User avatar
New member

Posts

Joined
Wed Jun 30, 2010 9:13 pm
Location - Cornwall

Post by letxobnav » Sun Jun 09, 2019 10:27 am

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;
}

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: No registered users and 345 guests