Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / can shipping type force payment type?

can shipping type force payment type?

Locked

Views: 1,314

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Jul 2008, 1:23 PM
#1
kinkyropes avatar

kinkyropes

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

can shipping type force payment type?

I travel frequently to do trade shows. At these shows I offer a discount for preorders, with a down payment necessary.

I can easily clone the free shipping module to make a 'pick up at the trade show' shipping method. And I can (probably) use the Installment Plan Payment Module to make a 'preorder discount + downpayment' payment method.

What I would like, is if the customer selects regular shipping the payment screen will show payment options of credit card and money order but not preorder discount, and if the customer selects pickup as the shipping method the payment screen will show preorder discount but not credit card or money order.

Will this even be possible? Or should I hunt for some other way to set this all up?

9 Jul 2008, 6:53 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: can shipping type force payment type?

If you use the "Store Pickup" module for the trade show pickup, you could edit the update_status() function in the desired payment module so that it would disable itself if the shipping method is not set to "storepickup".

Basically, adding a line akin to this (depending on a number of factors):```
[B]if ($_SESSION['shipping'] == 'storepickup_storepickup') $check_flag = false;
[/B]

if ($check_flag == false) {
$this->enabled = false;
}

Something like that should point you in the right direction.
9 Jul 2008, 6:06 PM
#3
kinkyropes avatar

kinkyropes

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

Re: can shipping type force payment type?

First of all, thanks for cluing me in about the store pickup module. I hadn't even thought to check if there was one pre-built into zencart.

The solution you gave doesn't quite work. That block of code is inside a check for zones. Since I am not using zones, it never executes that part of the code. If I set the flag before that block it will only get set back when the zones are checked.

But now that I knew what to look for, I was able to find another thread that addressed the issue. http://www.zen-cart.com/forum/showthread.php?p=343559 Its the same general idea but instead of setting the flag, your setting the enables itself. Put that in right before the block of code that checks zones and it all works fine.

Oh, and it should be $_SESSION['shipping']['id'] and not just $_SESSION['shipping']

Another thread that helped with my solution was http://www.zen-cart.com/forum/showthread.php?t=77374