can the code for updating the table for who updated the order just be included in orders.php?
Printable View
can the code for updating the table for who updated the order just be included in orders.php?
The section below is from my orders.php, i've managed to merge all other tracking mods into your osh_updated_by_functions.php file, but I can't figure this but out.
What do I need to do in this section?
PHP Code:
$email_comments = (zen_not_null($message) && $email_include_message === true) ? (OSH_EMAIL_TEXT_COMMENTS_UPDATE . $message . "\n\n") : '';
PHP Code:
$notify_comments = '';
// BEGIN TY TRACKER 3 - E-MAIL TRACKING INFORMATION ----------------------------------
if (isset($_POST['notify_comments']) && ($_POST['notify_comments'] == 'on')) {
if (zen_not_null($comments)) { $notify_comments = EMAIL_TEXT_COMMENTS_UPDATE . $comments . "\n\n"; }
if (zen_not_null($track_id1)) { $notify_comments .= "\n\nYour " . CARRIER_NAME_1 . " Tracking ID is " . $track_id1 . " \n<br /><a href=" . CARRIER_LINK_1 . $track_id1 . ">Click here</a> to track your package. \n<br />If the above link does not work, copy the following URL address and paste it into your Web browser. \n<br />" . CARRIER_LINK_1 . $track_id1 . "\n\n<br /><br />It may take up to 24 hours for the tracking information to appear on the website." . "\n<br />"; }
if (zen_not_null($track_id2)) { $notify_comments .= "\n\nYour " . CARRIER_NAME_2 . " Tracking ID is " . $track_id2 . " \n<br /><a href=" . CARRIER_LINK_2 . $track_id2 . ">Click here</a> to track your package. \n<br />If the above link does not work, copy the following URL address and paste it into your Web browser. \n<br />" . CARRIER_LINK_2 . $track_id2 . "\n\n<br /><br />It may take up to 24 hours for the tracking information to appear on the website." . "\n<br />"; }
if (zen_not_null($track_id3)) { $notify_comments .= "\n\nYour " . CARRIER_NAME_3 . " Tracking ID is " . $track_id3 . " \n<br /><a href=" . CARRIER_LINK_3 . $track_id3 . ">Click here</a> to track your package. \n<br />If the above link does not work, copy the following URL address and paste it into your Web browser. \n<br />" . CARRIER_LINK_3 . $track_id3 . "\n\n<br /><br />It may take up to 24 hours for the tracking information to appear on the website." . "\n<br />"; }
if (zen_not_null($track_id4)) { $notify_comments .= "\n\nYour " . CARRIER_NAME_4 . " Tracking ID is " . $track_id4 . " \n<br /><a href=" . CARRIER_LINK_4 . $track_id4 . ">Click here</a> to track your package. \n<br />If the above link does not work, copy the following URL address and paste it into your Web browser. \n<br />" . CARRIER_LINK_4 . $track_id4 . "\n\n<br /><br />It may take up to 24 hours for the tracking information to appear on the website." . "\n<br />"; }
if (zen_not_null($track_id5)) { $notify_comments .= "\n\nYour " . CARRIER_NAME_5 . " Tracking ID is " . $track_id5 . " \n<br /><a href=" . CARRIER_LINK_5 . $track_id5 . ">Click here</a> to track your package. \n<br />If the above link does not work, copy the following URL address and paste it into your Web browser. \n<br />" . CARRIER_LINK_5 . $track_id5 . "\n\n<br /><br />It may take up to 24 hours for the tracking information to appear on the website." . "\n<br />"; }
if (zen_not_null($track_id6)) { $notify_comments .= "\n\nYour " . CARRIER_NAME_6 . " Tracking ID is " . $track_id6 . " \n<br /><a href=" . CARRIER_LINK_6 . $track_id6 . ">Click here</a> to track your package. \n<br />If the above link does not work, copy the following URL address and paste it into your Web browser. \n<br />" . CARRIER_LINK_6 . $track_id6 . "\n\n<br /><br />It may take up to 24 hours for the tracking information to appear on the website." . "\n<br />"; }
// BEGIN TY TRACKER 3 - E-MAIL TRACKING INFORMATION --------------------------------------------------------------------
}
//send emails
$message =
You can certainly pull the $updated_by determination from /includes/functions/extra_functions/osh_updated_by_functions.php and include that in your customized version of orders.php.
You'll need also to copy the zen_updated_by_admin function and the code that adds the updated_by field to the database (if not already present).
Please note: The notifiers issued by the zen_update_orders_history common function are used by a fair number of my other plugins to recognize that an order's status information is being updated and, if so, what has changed.
Oh, let me hunt that up. I created an OSH/orders.php merge that includes Ty Package Tracker support a while ago ...
Ahh, there it is: Attachment 14900
Don't be put off by the zip-file's name, SNAP Affiliates is one of the plugins that depends (heavily) on the notifiers issued by the OSH common function.
Ok, the tracking info now sends via email, and everything seems to work in that regard, but for some strange reason, it is still not updating the updated by field
everything is being updated, comments, tracking, status, if the customer should be sent and email or not, the only thing not being updated is updated_by
Any debug-logs being generated?
nope, is there anything i can echo in order.php to check the status of the functions?
If i change the status of the order without entering a comment or tracking info, a new record is being generated in TABLE_ORDER_STATUS_HISTORY
but nothing is being inserted into updated_by
Look in /includes/functions/extra_functions/osh_updated_by_functions.php to find the following fragment, adding the line in red:
That will create a debug-log file that contains the value of the IS_ADMIN_FLAG (which should be true) and the $updated_by value (which should be null).Code:error_log (print_r (IS_ADMIN_FLAG, true) . ', ' . print_r ($updated_by, true));
if (!zen_not_null($updated_by)) {
if (IS_ADMIN_FLAG === true && isset($_SESSION['admin_id'])) {
$updated_by = zen_updated_by_admin();
} elseif (IS_ADMIN_FLAG === false && isset($_SESSION['customers_id'])) {
$updated_by = '';
} else {
$updated_by = 'N/A';
}
}