Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Minimum purchase to activate the cod payment module.

Minimum purchase to activate the cod payment module.

Views: 3,648

Results 1 to 16 of 16
22 Oct 2011, 1:16 PM
#1
deakoi avatar

deakoi

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Minimum purchase to activate the cod payment module.

Unable to find any post that could resolve my doubts, I wonder how I could do the following:

Purchases below 3€: display the Banktransfer payment module and hide the Cod payment module in the purchase process.
Purchases over 3€: display the Banktransfer payment module and the Cod payment module in the purchase process.

Thank you very much.

22 Oct 2011, 2:10 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Minimum purchase to activate the cod payment module.

You could customize the COD Payment Module by adding the code in RED to:
/includes/modules/payment/cod.php

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

// bof: turn off on orders less than 3
      if (!IS_ADMIN_FLAG) {
        global $cart;
        if ($_SESSION['cart']->show_total() < 3) {
          $this->enabled = false;
        }
      }
// eof: turn off on orders less than 3

      if ((int)MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
        $this->order_status = MODULE_PAYMENT_COD_ORDER_STATUS_ID;
      }
24 Oct 2011, 1:50 PM
#3
deakoi avatar

deakoi

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Minimum purchase to activate the cod payment module.

Ajeh thank you very much! :clap:

I don't know if this is the right thread to discuss it, but I would like to raise other issue that I don't know solve it:

Is it possible to apply the Cod payment module to several Payment Zones?

Thanks.

24 Oct 2011, 2:30 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Minimum purchase to activate the cod payment module.

You can build a Zone Definition with the DETAILS of who can use it and then add it to the COD Payment Module to limit who can use the COD Payment Module ...

24 Oct 2011, 5:01 PM
#5
deakoi avatar

deakoi

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Minimum purchase to activate the cod payment module.

Yes I know, but I have many defined Zones.
Is not there some other way to programmatically activate several areas in the Cod payment module?

24 Oct 2011, 5:22 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Minimum purchase to activate the cod payment module.

Can't you make a Zone Definition with the DETAILS set specifically for the COD module? :unsure:

24 Oct 2011, 5:47 PM
#7
deakoi avatar

deakoi

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Minimum purchase to activate the cod payment module.

Yes I can. Only wanted to know if there was a more direct way to do it. :wink:

The way you say, I would have to redefine many details again in a new specific area for Cod payment module.

24 Oct 2011, 5:50 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Minimum purchase to activate the cod payment module.

Maybe I am not understanding what you are trying to do ... :unsure:

I thought you wanted to add Zones or something to the COD module ...

If you mean you want to put the same type of limitation in other Payment modules ... then I am on the wrong track ...

You just need to add the similar code to any Payment Module where you want to control usage ...

24 Oct 2011, 6:10 PM
#9
deakoi avatar

deakoi

New Zenner

Join Date:
Oct 2011
Posts:
7
Plugin Contributions:
0

Re: Minimum purchase to activate the cod payment module.

Don't worry, you were right: "I want to add Zones to the COD payment module" but I wanted to know if it was possible to add multiple Zones simultaneously. Thank you very much.

And if not asking too much...
If I would like to apply a 3.5% commission to the total of purchases made by Cod payment module for the specific Zone you mention, how should I use the ot_cod_fee module?

30 Mar 2012, 8:28 PM
#11
crashxtrme avatar

crashxtrme

New Zenner

Join Date:
Mar 2012
Posts:
17
Plugin Contributions:
0

Re: Minimum purchase to activate the cod payment module.

Hi Ajeh,

Please help me to disable cod on weights below 4 kgs.

30 Mar 2012, 9:19 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: Minimum purchase to activate the cod payment module.

Same code but use:

$_SESSION['cart']->show_weight()
31 Mar 2012, 6:15 PM
#13
crashxtrme avatar

crashxtrme

New Zenner

Join Date:
Mar 2012
Posts:
17
Plugin Contributions:
0

Re: Minimum purchase to activate the cod payment module.

Hi Ajah, thanks for your prompt reply.
I tried it still not working, cod is always displayed.

31 Mar 2012, 6:24 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: Minimum purchase to activate the cod payment module.

This seems to work fine using the code in RED:

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

// bof: turn off on orders less than 4
      if (!IS_ADMIN_FLAG) {
        global $cart;
        if ($_SESSION['cart']->show_weight() < 4) {
          $this->enabled = false;
        }
      }
// eof: turn off on orders less than 4

      if ((int)MODULE_PAYMENT_COD_ORDER_STATUS_ID > 0) {
31 Mar 2012, 6:41 PM
#15
crashxtrme avatar

crashxtrme

New Zenner

Join Date:
Mar 2012
Posts:
17
Plugin Contributions:
0

Re: Minimum purchase to activate the cod payment module.

Ignore my last messege it worked :) Thanks bro.

31 Mar 2012, 6:46 PM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Minimum purchase to activate the cod payment module.

Thanks for the update that this is working for you ... :smile: