You would either need to purchase a mod that allows you to do this, or modify the system yourself.
If you're going to modify the system yourself, you will need to start by adding a new column to the order table in the database. This is where your new field information will be stored.
You would then need to edit your files to add the new field, as well as save the data of this field. To do this, edit the following files:
catalog/view/theme/default/template/checkout/shipping_method.tpl
This is where you would add the new field.
Code: Select all
<input type="text" name="your_field" value="<?php echo $your_field; ?>" class="form-control" />
catalog/controller/checkout/shipping_method.php
This is where you would capture the value that the customer has added. You would then save this value as a session variable similar to how the comment is saved.
Code: Select all
if (isset($this->session->data['your_field'])) {
$data['your_field'] = $this->session->data['your_field'];
} else {
$data['your_field'] = '';
}
Within the function "save" you would need to save your field data. Find:
Code: Select all
$this->session->data['comment'] = strip_tags($this->request->post['comment']);
Add After:
Code: Select all
$this->session->data['your_field'] = strip_tags($this->request->post['your_field']);
catalog/controller/checkout/confirm.php
Send this field data to the add order function so that it's saved to the database
Find:
Code: Select all
$order_data['comment'] = $this->session->data['comment'];
Add After:
Code: Select all
$order_data['your_field'] = $this->session->data['your_field'];
catalog/model/checkout/order.php
Within the addOrder function, you need to push your new field data to the database.
Find:
Code: Select all
, comment = '" . $this->db->escape($data['comment']) . "'
Add After Inline:
Code: Select all
, your_field = '" . $this->db->escape($data['your_field']) . "'
This should be enough to capture the information. You would still need to modify your admin panel to display this new field on the orders detail page.
Please note that I have not tested any of the code examples above.
Cheers,
Joel.