Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Only show payment method when UPS shipping method chosen?

Only show payment method when UPS shipping method chosen?

Locked

Views: 3,432

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
28 Aug 2008, 1:52 AM
#1
helen610 avatar

helen610

New Zenner

Join Date:
Jan 2008
Posts:
8
Plugin Contributions:
0

Only show payment method when UPS shipping method chosen?

I'm trying to figure out how to limit the payment methods shown depending on the shipping method chosen at checkout (step 1), but I can't figure out what's wrong.

After scouring the boards, it seems like this should be correct.. but the payment methods still shows up in checkout regardless of the shipping method I chose.

ex: cc.php line 56

	 //  Only allow orders when ship by upsxml
if ($_SESSION['shipping']['title'] = 'upsxml') 	{ 
$this->enabled = ((MODULE_PAYMENT_CC_STATUS == 'True') ? true : false);
}

I tried switching upsxml with upsxml_upsxml and Flat Rate, but no change.

Any ideas?

28 Aug 2008, 2:04 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Only show payment method when UPS shipping method chosen?

Have you tried just $_SESSION['shipping']['id'] instead of ['title'] to it?

example using the ups.php shipping module:
$_SESSION['shipping']['title'] = United Parcel Service (1 x 11.10lbs) (3 Day Select)
$_SESSION['shipping']['id'] = ups_3DS

Also, if a module is turned off (ie: disabled or uninstalled) then it won't even be triggered for evaluation. You're better to have it enabled, and then have the code disable it if it doesn't apply.