Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Payment based on shipping method?

Payment based on shipping method?

Locked

Views: 1,610

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
19 Nov 2008, 12:57 AM
#1
jeff_g avatar

jeff_g

Zen Follower

Join Date:
Oct 2007
Posts:
132
Plugin Contributions:
0

Payment based on shipping method?

Hi,

Is there any setting that would allow changing the payment method based on the shipping method?

We have pick-up or delivery & cash or CC (offline processing)

We would like to show only cash (possibly with a modifed message) if the order is for pickup. There is no need for the customer to enter CC info online if they are coming into the store.

I have not looked at the code yet where I'm sure it could be done, but would like to know if there is some setting before I go there.

Thanks,
Jeff

23 Nov 2008, 5:14 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Payment based on shipping method?

You could add a condition to the Payment methods by controlling the $this->enabled and testing with the value of:
$_SESSION['shipping']['id']

23 Nov 2008, 5:46 AM
#3
jeff_g avatar

jeff_g

Zen Follower

Join Date:
Oct 2007
Posts:
132
Plugin Contributions:
0

Re: Payment based on shipping method?

Good timing. I was just working on this when you replied.

The only place I could find to add this was tpl_checkout_payment_default.php.

This is what I came up with and it seems to work. Is there a better place to put this?

  $selection = $payment_modules->selection();
	//jsg
	if ($_SESSION['shipping']['id'] == 'storepickup_storepickup') {  
		$selection = '';
		$selection[0]['id'] = 'cod';
		$selection[0]['module'] = 'Please pay when picking up order.';
	}

Thanks,
Jeff

23 Nov 2008, 9:48 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Payment based on shipping method?

You could customize the Payment modules you are using to control when they show or do not show with something similar ...