Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Trouble cloning - incorrect values passed to the checkout_payment page

Trouble cloning - incorrect values passed to the checkout_payment page

Locked

Views: 1,909

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
8 Aug 2008, 2:50 PM
#1
bjornenke avatar

bjornenke

New Zenner

Join Date:
Aug 2008
Posts:
2
Plugin Contributions:
0

Trouble cloning - incorrect values passed to the checkout_payment page

Hello,

I have almost successfully cloned the "flat" shipping module into what I am looking for - basically adding several price options instead of just one for each "flat" clone.

(For example, instead of just $5.00 flat, you can choose $5.00 flat 3 day, $8.00 flat for 2 day or $12.00 flat for next day)

*Sample Code:

$methods = array();

		$methods[] = array('id' => 'optionone',
						  'title' => MODULE_SHIPPING_BEZONE4_TEXT_WAY,
						  'cost' => MODULE_SHIPPING_BEZONE4_COST);
						  
	    $methods[] = array('id' => 'optiontwo',
						  'title' => MODULE_SHIPPING_BEZONE4_TEXT_WAY2,
						  'cost' => MODULE_SHIPPING_BEZONE4_COST2);

    $this->quotes['methods'] = $methods;*

Everything seems OK on "Step 1 of 3 - Delivery Information". My new radio options show up and I've checked the code and their values seem good.

The problem I am having occurs on "Step 2 of 3 - Payment Information". The shipping option and price show the title and price of the first appearing radio option in my clone no matter which option is checked.

(For example, if there are three options A,B,C, and B or C is checked on "Step 1 of 3" - "Step 2 of 3" shows A as what was checked.

I cannot for the life of me figure out why this is happening and any help would be greatly appreciated.

8 Aug 2008, 3:42 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Trouble cloning - incorrect values passed to the checkout_payment page

The "flat" module was never built for multiple choices. Thus you may need to look at another module for inspiration on what additional changes you'll need to make to accommodate for multiple selections to remember what was chosen.

USPS generates a list of radio buttons based on available services, and then remembers the selected choice between pages. You might find some helpful code in that module, which you could adapt for use in your custom module.

9 Aug 2008, 1:49 AM
#4
bjornenke avatar

bjornenke

New Zenner

Join Date:
Aug 2008
Posts:
2
Plugin Contributions:
0

Re: Trouble cloning - incorrect values passed to the checkout_payment page

Thanks a for the quick replies.

I tried building a clone off of the USPS module but had the same problem with the shipping page in that it was not passing the correct options to the checkout/payment page. But that did steer me in the right direction.

I checked out a few of the modules on the page suggested by Ajeh and the "static list" module ended up being exactly what I was looking for. =)

Thanks again to both of you!

Bjorn

9 Aug 2008, 3:42 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Trouble cloning - incorrect values passed to the checkout_payment page

Glad that one of those was able to help you ... thanks for letting us know what solution worked best for you ... :smile: