Forums / Built-in Shipping and Payment Modules / Set maximum order price for Cash On Delivery

Set maximum order price for Cash On Delivery

Views: 976

Results 1 to 4 of 4
25 Apr 2012, 1:38 PM
#1
jascampbell avatar

jascampbell

New Zenner

Join Date:
Apr 2012
Posts:
1
Plugin Contributions:
0

Set maximum order price for Cash On Delivery

I'm trying to work out how to set a maximum order price for the Cash on Delivery option.
Our courier service only allows Cash on Delivery for deliveries of up to €500. I do not want this option (COD) to appear on the payment page if the order total is more than €500. How do I do this?

25 Apr 2012, 1:53 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Set maximum order price for Cash On Delivery

You can customize the file:
/includes/modules/payment/cod.php with the code in Red:

      if ((int)MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
        $this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID;
      }
      
      // bof: disable on total > 500 is subtotal use subtotal
      if (!IS_ADMIN_FLAG) {
       if ($order->info['total'] > 500) {
         $this->enabled = false;
        }
      }
      // eof: disable on total > 500 is subtotal use subtotal

      if (is_object($order)) $this->update_status();

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!

27 Oct 2013, 2:52 PM
#3
diamond1 avatar

diamond1

Zen Follower

Join Date:
Jan 2010
Location:
France
Posts:
295
Plugin Contributions:
0

Re: Set maximum order price for Cash On Delivery

thanks and what I wanted and works with version 1.5.1

Giovanni,
Zen Cart V2.1

27 Oct 2013, 3:24 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Set maximum order price for Cash On Delivery

Thanks for the update that this is working 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!