This will set up 4 options with "system" as the default option, this means that "system" should be inserted when (eg) Paypal is used [which I think sends an item to the orders_status_history]. Note that all existing comments will be set to N/A as we do not know who/what added existing comments.
ALTER TABLE orders_status_history ADD added_by ENUM('system', 'admin', 'customer', 'N/A') NOT NULL DEFAULT 'system' AFTER comments;
UPDATE TABLE orders_status_history SET added_by = 'N/A';
CONCEPT CODE
These are (unfortunately) hardcoded changes, which obviously change core code, which is something we try not to do. Could probably be done by Hook, but I don't have time to look at it. Maybe these ideas or concept code could be taken by someone and made into a nice addon for PRO members?
1. admin/includes/actions/orders/update_order.php
Find:
$db->perform('orders_status_history', [
Add After:
Code: Select all
'added_by' => 'admin',Find:
$sql_data = [
Add After:
Code: Select all
'added_by' => 'customer',Find:
<th><?= TABLE_HEADING_DATE_ADDED ?></th>
Add After:
Code: Select all
<th>Added By</th>echo '<td>' . $orders_history['date_added'] . '</td>';
Add After:
Code: Select all
echo '<td>' . $orders_history['added_by'] . '</td>';