Zen Cart Logo
Forums / PayPal Express Checkout support / Disable PayPal-payment when customer reachers a certain subtotal

Disable PayPal-payment when customer reachers a certain subtotal

Locked

Views: 1,633

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
12 Mar 2009, 7:59 PM
#1
andersw avatar

andersw

New Zenner

Join Date:
Dec 2008
Posts:
22
Plugin Contributions:
0

Disable PayPal-payment when customer reachers a certain subtotal

Hi, I am trying to disable PayPal when a customer reaches a certain subtotal in his order. Is this possible?

12 Mar 2009, 10:05 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Disable PayPal-payment when customer reachers a certain subtotal

You will need some custom code to check in I believe step 2 of checkout where payment methods are displayed

13 Mar 2009, 5:00 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Disable PayPal-payment when customer reachers a certain subtotal

I am not sure what PayPal you are using but to customize the:
/includes/modules/payment/paypal.php

file you can add to the code below line 79 or so that reads:

    if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) != '3.8') $this->enabled = false;

and change to read:

    if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) != '3.8') $this->enabled = false;

// turn off the $this->enable to hide this payment method when products_id 26 is in the cart
    if (IS_ADMIN_FLAG === false && $_SESSION['cart']->total > 900) {
      $this->enabled = false;
    }

where 900 is the amount you want to disable the module for ...

The goal for enabling or disabling any of the modules is to control the:
$this->enabled

When $this->enabled = false the module will be disabled or hidden ...

When $this->enabled = true the module will be enabled or showing ...