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?