Re: Enable PayPal but Only when Product ID 1234 is in cart?
Are you having an issue of seeing PayPal in the checkout or on the shopping cart?
This only works in the checkout not the shopping cart ...
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Quote:
Originally Posted by
Ajeh
Are you having an issue of seeing PayPal in the checkout or on the shopping cart?
This only works in the checkout not the shopping cart ...
It's PayPal Express but the issue is on both the login page (where the PPE button appears) and on the order confirmation page where the PP radio button appears. So, it's as though the code is not doing anything at all.
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Are you trying to make PayPal work when products_id 1395 is the ONLY product in the cart? Or, when this is one of several Products in the cart?
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Quote:
Originally Posted by
Ajeh
Are you trying to make PayPal work when products_id 1395 is the ONLY product in the cart? Or, when this is one of several Products in the cart?
Ideally, when it's the only product in cart. So, if any other product was in the cart, PayPal would not be an option.
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Aha! a clue ...
Try this code instead so it checks against the total quantity of Products in the cart to ensure they are all products_id 1395 ...
Code:
if (!IS_ADMIN_FLAG) {
// disable, (even when admin has it switched on):
$this->enabled = false;
if ($_SESSION['cart']->in_cart_check('products_id','1395') > 0 && $_SESSION['cart']->count_contents() == $_SESSION['cart']->in_cart_check('products_id','1395')) {
$this->enabled = true;
}
}
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Hi Linda,
Getting there. It works on main_page=checkout as it takes away the PayPal radio buttonh for all products except 1395. It' s not working on main_page=shopping_cart or main_page=login though. These still give the PayPal Express yellow button. Is there a simple way to apply the same logic to these pages?
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Customize the shopping cart template using your templates and overrides with similar code to hide the button based on a similar check ...
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Quote:
Originally Posted by
Ajeh
Customize the shopping cart template using your templates and overrides with similar code to hide the button based on a similar check ...
Thanks Linda. I'll get a look at that later on but thank you for the coding as it's really useful to me.
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Thanks for the update ... let us know the final results on this ... :smile:
Re: Enable PayPal but Only when Product ID 1234 is in cart?
Quote:
Originally Posted by
RodG
Thanks for the suggestion, I have been following this thread because I have exactly the same problem ... or rather I need to do exactly the same ...
I hope Ajeh can help us... :D
Thanks and regards!