Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

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

Started by helen610 on 28 Aug 2008, 1:52 AM · Views: 3,444

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,511
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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.