Forums / Built-in Shipping and Payment Modules / How can I have different payment options for different shipping options?

How can I have different payment options for different shipping options?

Locked

Views: 3,233

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
17 Feb 2010, 9:47 AM
#1
liamv avatar

liamv

New Zenner

Join Date:
Feb 2010
Posts:
73
Plugin Contributions:
0

How can I have different payment options for different shipping options?

I offer two shipping options Flat rate courier and store pickup.

and I offer two payment options PayPal and Cash on pickup.

If a customer selects the flate rate courier option on the 'Delivery Information' page when they progress to 'Payment Information' page they still get the option of 'pay cash on delivery'/pickup.

How do I change it so that if they select a courier dispatch the 'pay cash on delivery'/pickup option does not show?

I am using the ZJ Black template

Many thanks in advance. Once I have this resolved I can go live.

17 Feb 2010, 3:35 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: How can I have different payment options for different shipping options?

You would need to customize your Payment Module(s) by disabling the $this->enabled based on the setting:
$_SESSION['shipping']['id']

Flat Rate flat shipping module, for example, will give $_SESSION['shipping']['id'] as flat_flat

The Store Pickup storepickup will give storepickup_storepickup

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!

17 Feb 2010, 8:01 PM
#3
liamv avatar

liamv

New Zenner

Join Date:
Feb 2010
Posts:
73
Plugin Contributions:
0

Re: How can I have different payment options for different shipping options?

Ajeh:

You would need to customize your Payment Module(s) by disabling the $this->enabled based on the setting:
$_SESSION['shipping']['id']

Flat Rate flat shipping module, for example, will give $_SESSION['shipping']['id'] as flat_flat

The Store Pickup storepickup will give storepickup_storepickup

Thanks Ajeh, I am a bit of a newbie but have managed to customise a few things here and there already.

Can you give me a bit more detail on how to do this?

Many thanks in advance

18 Feb 2010, 12:25 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: How can I have different payment options for different shipping options?

What Payment Module are you using for the Cash 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!

18 Feb 2010, 12:36 AM
#5
liamv avatar

liamv

New Zenner

Join Date:
Feb 2010
Posts:
73
Plugin Contributions:
0

Re: How can I have different payment options for different shipping options?

Ajeh:

What Payment Module are you using for the Cash Payment?

I was using one the COD module which I was successful in renaming "Cash on Pick up'

18 Feb 2010, 2:11 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: How can I have different payment options for different shipping options?

This would disable the COD Payment Module when the Flat Rate flat Shipping module has been selected by changing the code in:
/includes/modules/payment/cod.php

where it reads:

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

to read:

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

      // do not show COD when shipping is Flat Rate
      if ($_SESSION['shipping']['id'] == 'flat_flat') {
        $this->enabled = false;
      }

Now if Flat Rate flat shipping module is selected then the COD Payment Module will be disabled and not shown ...

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!

18 Feb 2010, 2:57 AM
#7
liamv avatar

liamv

New Zenner

Join Date:
Feb 2010
Posts:
73
Plugin Contributions:
0

Re: How can I have different payment options for different shipping options?

Ajeh:

This would disable the COD Payment Module when the Flat Rate flat Shipping module has been selected by changing the code in:
/includes/modules/payment/cod.php

where it reads:

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

      // do not show COD when shipping is Flat Rate
      if ($_SESSION['shipping']['id'] == 'flat_flat') {
        $this->enabled = false;
      }

Now if Flat Rate flat shipping module is selected then the COD Payment Module will be disabled and not shown ...

Ajeh, many thanks that worked just perfectly. All I have to do now is test the payment processes, add some more products and go live

Thank you so much. If you want to take a coffee break have a look at the site https://www.fastbikegear.co.nz

I've set all of the stock other than Indicator Reminders to zero until we have finished testing it.

Critiscms and suggestions valued!

18 Feb 2010, 3:32 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: How can I have different payment options for different shipping options?

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