close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Adding input field to checkout page?

Thread began 1/30/2014 10:38 am by sjones435326 | Last modified 1/30/2014 4:46 pm by sjones435326 | 291 views | 5 replies

sjones435326

Adding input field to checkout page?

Hello, I'm trying to add a form (text) field to the checkout section of an Ecart 5 site. I needed to add a "Company" field to the form.
I can't get the value from the text field to show up in the DB orders table.
Here is what I have done so far.

In the checkout.php page I have added

<tr>
<th><label for="company" >Company</label></th>
<td><input type="text" name="company" id="company" value="" /></td>
</tr>

&

<tr>
<th><label for="shipping_company" >Shipping company</label></th>
<td><span id="sprytextfield8">
<input type="text" name="shipping_company" id="shipping_company" value="" />
</span></td>
</tr>

&

I have updated the copyShipping.js file, adding the company & shipping_company values to the array

Then on the confirm.php page I have added this

<?php
if (!session_id()) session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION["eCartCheckoutForm_company"] = "".((isset($_POST["company"]))?$_POST["company"]:"") ."";
}
?>

&

<?php
if (!session_id()) session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION["eCartCheckoutForm_shipping_company"] = "".((isset($_POST["shipping_company"]))?$_POST["shipping_company"]:"") ."";
}
?>

Also

<br /><?php echo((isset($_POST["company"]))?$_POST["company"]:"") ?> (Billing Information)
<br /><?php echo((isset($_POST["shipping_company"]))?$_POST["shipping_company"]:"") ?> (Shipping Information)

I have also created a column in the DB table "OrderShipCompany" this is where I would like to store the Company name that the user inputs.

When looking in the Server Behaviors for the confirm.php page, I see a eCart Store Details in Database but it updates the orderdetails table.

Can you please give me this last step that I'm missing to get the new company input value stored into the orders table?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...