Zen Cart Logo
Forums / Addon Payment Modules / disable/enable nochex payment mod based on amount?

disable/enable nochex payment mod based on amount?

Locked

Views: 1,187

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
14 Feb 2010, 4:15 AM
#1
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

disable/enable nochex payment mod based on amount?

Dear All,

I used the Paypal and nochex payment mod for my cart. I only have a seller account in Nochex therefore, I can only take a maximum of 100 per transaction. The mod itself do not have function such as enable/disable this mod when amount more/less than X.

I am wondering if I can add a line of code somewhere to make this happen.

Many many thanks for help in advance

Gen

14 Feb 2010, 5:52 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: disable/enable nochex payment mod based on amount?

I do not use this Payment Module, but you can try to disable it for orders > 100 by changing:

    $this->enabled = ((MODULE_PAYMENT_NOCHEX_STATUS == 'True') ? true : false);

to read:

    $this->enabled = ((MODULE_PAYMENT_NOCHEX_STATUS == 'True') ? true : false);
    
    // bof: disable over 100
    if ($order->info['total'] > 100.00) {    
      $this->enabled = false;
    }
    // eof: disable over 100

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!

19 Feb 2010, 1:42 AM
#4
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

Re: disable/enable nochex payment mod based on amount?

My apologise. Can I just ask, would it be right to copy this code to nochex_apc.php which found under this directory - includes/modules/payment/nochex_apc.php ? :oops:

Thanks again

19 Feb 2010, 1:56 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: disable/enable nochex payment mod based on amount?

Yes, the Payment Modules are located in the:
/includes/modules/payment

I would save a copy of the original file on your computer, do not load a duplicate renamed copy on the server as it will produce errors ...

Then add the change and see if that works properly for you ...

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!

19 Feb 2010, 1:56 AM
#6
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

Re: disable/enable nochex payment mod based on amount?

Wonderful!

Here it is.

edit includes/modules/payment/nochex_apc.php

On Line 66, you will see the following code.

    $this->enabled = ((MODULE_PAYMENT_NOCHEX_STATUS == 'True') ? true : false);

Insert the following code immediately after

    // bof: disable over 100
    if ($order->info['total'] > 100.00) {    
      $this->enabled = false;
    }
    // eof: disable over 100

Work Perfect! All credit goes to Ajeh. Thank you :hug:

19 Feb 2010, 2:04 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: disable/enable nochex payment mod based on amount?

Thanks for the update that this code customization was able to work for you ... :smile:

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!