Adding fields to order delivery in v1.4

Jo

No avatar

2006-10-07 20:53

I have checked through old posts and cant find answer.

In previous versions (1.2 & 1.3) I had this working but now it's not. I have added and changed some values in orders_delivery.tpl, then changed values in core/orders.php to match. I have also added fields in js/orders.js as I presume this is how data is stored before customer checks out.

Problem is, if I try to place a test order i get the message "please fill in all required fields" even if all fields are filled in. Also, when I return to orders_delivery page after that, not all fields have kept their info, the city field and country (added by me) do not hold info.

Can anyone tell me what I have missed?

Thanks.

Jo

No avatar

2006-10-13 12:55

Can anyone help me here? I really need more fields in orders_delivery as there is not enough for a full UK address, I also need a country option to accept orders from more than 1 country...please help me!

Thanks!

Jo

No avatar

2006-10-15 17:58

I think the problem I'm having is with core/orders-ff.php. I'm not sure where to add the extra info. I believe it is something like this:

'$'.$aExp[1]""$'.$aExp[2]"

from reading this post - http://opensolution.org/Quick.Cart/forum/?p=readTopic&nr=214

but I'm not sure where in the file to add the code. Looks like no-one is going to reply but I really hope someone can help me!

Jo

No avatar

2006-10-15 20:32

Here I am again :)

I have the extra fields being passed through to orders_more now, that works fine, but now delivery total does not appear on orders_more or orders_print

Need help!

rutger

No avatar

2006-10-15 23:03

I want also change the order delivery field. How do i change an input field to a select field? When i change the code in orders_delivery.tpl there is also the "please fill in all required fields" error.

Jo

No avatar

2006-10-16 19:42

If you are wanting a select field as in the same as the 'courier' field I would copy all info for courier field from core/orders.php and templates/orders_delivery.tpl, and edit it to the new info you want.

i'm not 100% sure but that might help you.

Jo

No avatar

2006-10-17 01:12

That doesn't quite work, can anyone tell me - to get another drop down list in orders_delivery page do I have to use all files similar to courier option (i.e. templates/couriers.tpl, db/couriers, core/couriers etc. etc.) or can I add a simple drop down list somehow. I have tried a regular drop down and it isn't working.

I would like another list so that I can add what payment method the customer will be using.

Jo

No avatar

2006-10-17 01:28

Sorry! ignore the last post, I had made a mistake in core/orders.php.

---------------------------------------------------

To add a select field (drop down list) to templates/orders_delivery.tpl, add your form like so (e.g. I have used payment option) in orders_delivery.tpl:

<select name="sPayment_option" onblur="saveUserData( this.name, this.value )" value="$aData[sPayment_option]">
<option value=""> $lang[choose] </option>
<option value="credit/debit_card">Credit/Debit Card</option>
<option value="paypal">Paypal</option>
<option value="nochex">Nochex</option>
<option value="cheque">Cheque (UK only)</option>
<option value="postal_order">Postal Order (UK only)</option>
</select>

Then in core/orders.php

find line that begins - list( , $aList['iTime'], $aList['iCourier'],

add info at the end of that line - e.g. $aList['sPayment_option']

so it ends like this - ..."$aList['sComment'], $aList['sPayment_option'] ) = $aList;"

Also, find the line that begins - "dbAddOrderExtensions"

at the end of that line add the name of the info added - e.g. $aForm['sPayment_option']

so it ends like this - ..."$_SERVER['REMOTE_ADDR'], $aForm['sComment'], $aForm['sPayment_option'] ) );"

------------------------------------------------------------

I think that's everything. Good luck!

Jo

No avatar

2006-11-18 22:47

Oh, I forgot the admin side. After doing the above do this:

Open core/orders-admin.php abd fine the line that starts like this:

list( $aList['iOrder'], $aList['iTime'], $aList['iCourier'], $aList['sCourier']

add info at the end of that line - e.g. $aList['sPayment_option']

so it ends like this - ..."$aList['sComment'], $aList['sPayment_option'] ) = $aData[$i];"


That should be everything...

prince

No avatar

2006-12-12 05:01

Hello Jo,

Where exactly do i add the following code in orders_delivery.tpl:

<select name="sPayment_option" onblur="saveUserData( this.name, this.value )" value="$aData[sPayment_option]">
<option value=""> $lang[choose] </option>
<option value="credit/debit_card">Credit/Debit Card</option>
<option value="paypal">Paypal</option>
<option value="nochex">Nochex</option>
<option value="cheque">Cheque (UK only)</option>
<option value="postal_order">Postal Order (UK only)</option>
</select>

Thanks
aj

Jo

No avatar

2006-12-15 13:24

that depends on where you want it!

I have added it in the table underneath the table row with the email input

So add a table row underneath that so it's something like this:

<tr>
<th bgcolor="#666666"> $lang[Email]: </th>
<td>
<input type="text" name="sEmail" value="$aData[sEmail]" maxlength="40" onblur="saveUserData( this.name, this.value )" />
<span class="style1">*</span> </td>
</tr>
<tr id="order_comment">
<th valign="top">&nbsp;</th>
<td>&nbsp;</td>
</tr>
<tr>
<th valign="top" bgcolor="#666666">$lang[payment_option]:</th>
<td><select name="sPayment_option" onblur="saveUserData( this.name, this.value )" value="$aData[sPayment_option]">
<option value=""> $lang[choose] </option>
<option value="Credit/Debit_card">Credit/Debit Card</option>
<option value="Paypal">Paypal</option>
<option value="Nochex">Nochex (UK only)</option>
<option value="Cheque">Cheque (UK only)</option>
<option value="Postal_Order">Postal Order (UK only)</option>
</select>
</td>
</tr>
<tr id="order_comment">
<th valign="top">&nbsp;</th>
<td>&nbsp;</td>
</tr>
<tr id="order_comment">
<th valign="top" bgcolor="#666666">$lang[Comment_order]:</th>
<td><textarea name="textarea" rows="7" cols=""></textarea></td>
</tr>
</table></td>
</tr>



If you need any more info feel free to ask :)

prince

No avatar

2006-12-15 17:29

hey jo,

I got it perfectly except the field name, Payment is not there.

Take a look, order something and go the order delivery page, thanks again

aj

idaryl

Avatar: idaryl

2006-12-16 01:20

Err, a link would be nice - lol

Jo

No avatar

2006-12-17 00:12

I think I know what you mean - the "$lang[payment_option]"?

If this is what you mean, this has to be added in the language file like so:

$lang['payment_option'] = 'Payment option:';

idaryl

Avatar: idaryl

2006-12-17 11:43

If anybody in the US is interested.. Use the above steps to add a State field - go through all the setups but use this drop menu for the states - works for me... (I called it sState) - I would suppose that someone else for example; Italy; could use this and just change the option values to match what they want. Sound feasable?

<select name="sState" onchange="saveUserData( this.name, this.value )" value="$aData[sState]">
<option value=""> $lang[choose] </option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>

prince

No avatar

2006-12-19 00:48

Hello Jo,

thanks that worked. now how do the following if i select the paypal option how do i go directly to paypal without having to press the paypal button.

http://beckiesbliss.com

thanks alot
aj

Back to top
about us | contact