Hi Stevesh and anyone else reading this thread who needs this option.
After a little bit of code crawling I found out how to do this. First off I will say that I am not a php master, just have a reasonable understanding of basic php and coding, so there may be a better way to do this. Please feel free to join in if you can improve this.
The usual disclaimer applies about backing up your database and file before making the changes so you can go back if it doesn't work of breaks something.
BTW I am using version 1.5.1, the line numbers below may be different to yours but they should be close.
- First I went in through phpMyAdmin and added a field to the manufacturers table called manufacturers_sort_order with a type of INT(11), default 0, NOT NULL
- Then I opened the file admin/manufacturers.php and made the following edits
Line 20, just after
$manufacturers_name = zen_db_prepare_input($_POST['manufacturers_name'])
Add
$manufacturers_sort_order = zen_db_prepare_input($_POST['manufacturers_sort_order']);
Line 22, change
$sql_data_array = array('manufacturers_name' => $manufacturers_name);
to
$sql_data_array = array('manufacturers_name' => $manufacturers_name, 'manufacturers_sort_order' => $manufacturers_sort_order);
Line 255, just after
$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_NAME . '<br>' . zen_draw_input_field('manufacturers_name', '', zen_set_field_length(TABLE_MANUFACTURERS, 'manufacturers_name')));
Add
$contents[] = array('text' => '<br>' . TEXT_MANUFACTURERS_SORT_ORDER . '<br>' . zen_draw_input_field('manufacturers_sort_order', '', 'size="3"'));
You could add this elsewhere in the form, but I wanted my field to appear under the name when adding or editing the manufacturer.
Line 287, just after
$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_NAME . '<br>' . zen_draw_input_field('manufacturers_name', htmlspecialchars($mInfo->manufacturers_name, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_MANUFACTURERS, 'manufacturers_name')));
Add
$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_SORT_ORDER . '<br>' . zen_draw_input_field('manufacturers_sort_order', $mInfo->manufacturers_sort_order, 'size="3"'));
That worked for me, and I suppose you can adapt this to add whatever fields you want.
I hope this helps someone else out there now, or in the future.