Thanks for the update and glad that this did work for you to control when your Payment modules shows or does not show based on the order total ...![]()
Thanks for the update and glad that this did work for you to control when your Payment modules shows or does not show based on the order total ...![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Hello again Linda et.al. - a similar problem as above!
Have all the functions that I can extract values from $_SESSION['cart'] been documented somewhere?!
My customer would like to disable credit card payment method (sagepay) when no valid shipping zones available for the shipping address/destination, allowing only Purchase Order.
So similar as above, but now I would need to see *in pseudo code*:
if ($_SESSION['cart']->check_if_valid_shippingzones_function_of_some_kind() == false)) {
// i.e. no valid shipping zones for this destination
// disable credit card payment method
$this->enabled = false;
} else {
$this->enabled = ((MODULE_PAYMENT_SAGEPAY_FORM_STATUS == 'True') ? true : false);
}
Thanks!
annika
If there isn't a valid shipping method selected then you will never get to the checkout_payment ...
Can you clarify what happens when you do not have a valid shipping address and how you are getting to the checkout_payment?![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Yes sorry, I also have always available the 'walk-in' i.e. 'storepickup' option (for all destinations & countries), and I have renamed it 'Arrange shipping after order', so that even when there are no valid shipping destinations, customer can go forward with this 'storepickup' and that's when only purchase order should be available for payment, no credit cards.
How about something along the lines of (this doesn't work though, not sure why?!):
includes/modules/payment/sagepay_form.php
// ANNIKA disabling the card payment option when chosen shipping method is "Arrange shipping after order"
if ($rates[$i]['module'] == 'storepickup')
{ $this->enabled = false;
} else {
$this->enabled = ((MODULE_PAYMENT_SAGEPAY_FORM_STATUS == 'True') ? true : false);
}
// ANNIKA END
Thanks!
annika