Page 1 of 1

How to hide PayPal express button from cart

Posted: Mon Nov 14, 2016 12:09 am
by kachman
hi devs and fellow members. I am a proud user of open and can only say good things about it right now :)

I am not a programmer but can understand few things about coding, with a little help. I have 4 questions I need help with

1. I would like to know how i can hide the PayPal express button from the shopping cart but keep it on the checkout Page. I dont want my registered customers to be tempted to use it right from the shopping cart when they are not logged in.

2. is it possible to make the radio button of "Register account" as the default selected one on the checkout page? because I have noticed that when guest checkout is disabled from the System settings, the page pops up an embarrasing error page if the "continue" is clicked without activating the radio button on "register account".

3. How do I make the PayPal express button appear below "Guest checkout" or make it replace that button altogether?

and 4. is it possible to make the paypal express button hidden until the Guest checkout radio button is enabled ?

Re: How to hide PayPal express button from cart

Posted: Wed Nov 16, 2016 5:43 am
by thekrotek
kachman wrote: 1. I would like to know how i can hide the PayPal express button from the shopping cart but keep it on the checkout Page. I dont want my registered customers to be tempted to use it right from the shopping cart when they are not logged in.
If you want it to hide for guests and registered customers, just use CSS "display: none" definition on this button. It's kinda fool proof, but works. Otherwise you need to check, whether customer is logged or not:

Code: Select all

if ($this->customer->isLogged()) {}
kachman wrote: 2. is it possible to make the radio button of "Register account" as the default selected one on the checkout page? because I have noticed that when guest checkout is disabled from the System settings, the page pops up an embarrasing error page if the "continue" is clicked without activating the radio button on "register account".
The easiest way is to edit checkout/login.tpl. The code is right at the beginning of it.
kachman wrote: 3. How do I make the PayPal express button appear below "Guest checkout" or make it replace that button altogether?
Again, by editing template file.
kachman wrote: and 4. is it possible to make the paypal express button hidden until the Guest checkout radio button is enabled ?
This might be achieved with simple JS. Something like this:

Code: Select all

if (($("input[name='account'].val() == 'guest') && ($("input[name='account'].is(':checked'))) {} "