PHOENIX ADMIN COMMENTS V1.1
28 October 2026

Reusable order comments for native Phoenix Orders and Advanced Order Manager.
Built against Phoenix 1.1.0.6 / PHP 8.2 and the supplied AOM V1.1 patches.
Confirmed working by the user on their test site, including darker buttons.
No Phoenix core or existing AOM files are replaced.
This package contains only Admin Comments. AOM search improvements are
distributed as a completely separate package.

NEW INSTALLATION - REPEAT ON EACH LIVE SITE
1. Back up the site files and database.
2. Upload the contents of catalog/ into the shop root. This installs:
   includes/hooks/admin/siteWide/adminComments.php
3. Upload the contents of admin/ into your ACTUAL admin directory (for example
   November/). Keep the includes/ subfolders intact. Do not upload admin/
   inside your existing admin folder as a nested directory.
4. Log in to admin and open Orders > Admin Comments.
   Alternatively open admin_comments.php in your actual admin directory.
5. Click Install Admin Comments once. It creates admin_comment_templates.
   Existing orders and Phoenix tables are not changed by installation.
6. Add your saved comments and enable them. Set the button order using Sort
   order (lower numbers first). Optional status: Leave unchanged is the default.
7. Press Ctrl+F5 on already-open order screens.

Each site's comments are stored in its own database. Uploading this package
creates no preset comments and does not copy the test site's saved wording.
Enter your desired comments through the admin page on each live site.

UPGRADE FROM THE V1.0 TEST PACKAGE
Upload catalog/ and admin/ as above, replacing the add-on files only.
Saved comments and settings remain in the database. No database upgrade or
reinstallation is required. Press Ctrl+F5 after uploading.
If the hook was disabled during diagnosis, ensure it is named
adminComments.php, not adminComments.php.off.

USING SAVED COMMENTS
Small grey buttons appear below the comment box in native Orders and AOM.
On AOM Edit Order, first load an existing order, then click Unlock Fields.
On AOM Add Order the buttons are available when the comment field is enabled.
Clicking appends the saved text on a new line and preserves existing text.
You can edit the text before saving. Optional status selection changes the
status dropdown if that status exists and the dropdown is enabled.
The normal Save / Update control is still required to save the order.
Notification checkboxes are unchanged; use the normal order notification
settings to control whether the customer receives an email.

ADMIN PAGE
Add, edit, delete, enable/disable and sort saved comments.
Button labels can contain up to 60 characters; shorter labels keep them small.
Comments are plain text and shared across admin languages. Status names use
the current admin language. Reload order pages after editing saved templates.

PLACEHOLDERS
{date}       today's date
{date:+1}    tomorrow
{date:+3}    three calendar days from today
{date:-1}    yesterday
{tracking}  prompts for a tracking number when the button is clicked

Dates use DD/MM/YYYY and the browser's local date. Days are calendar days.
Cancelling the tracking prompt, or entering a blank value, changes nothing.
Multiple placeholders can be used in a comment.

Example label: Dispatched
Example text: Your order was dispatched on {date}. Tracking: {tracking}

QUICK CHECK AFTER INSTALLING ON EACH SITE
Check button appearance and text insertion in native Orders, AOM Add Order
and AOM Edit Order. Check date/tracking prompts and optional status selection.
Verify an order saves through its normal controls and uses the intended
notification settings.

ROLLBACK / UNINSTALL
To disable the toolbar, rename the hook to adminComments.php.off.
To uninstall the add-on, remove the five PHP files and one JavaScript file
listed in FILES.txt. The saved templates remain in admin_comment_templates.
Keep/export that table if you may reinstall. Removing this add-on does not
remove any comments already saved in an order's history.

VALIDATION
User confirmed the completed flow and darker buttons working on the test site.
JavaScript syntax and focused toolbar / AOM lock-and-search checks passed.
No direct testing on the two live sites was performed by the assistant.
PHP runtime unavailable in the build environment for linting.

CREDITS / LICENCE
Inspired by osCommerce Admin Comments Toolbar by Adam Pingitore / Skeedo.com
and contributors. New implementation released under GNU GPL v2 or later.
