
Manager comment on an order
Add a text extra field to an order and use it on Extras → MiniShop3 → Orders.
Goal
A manager enters an internal order comment. The value is stored in the ms3_orders table and saved via PUT /api/mgr/orders/{id}.
Prerequisites
- MiniShop3 1.13.x
- Permission
mssetting_save(create extra field) - Permission
msorder_list(read order card) - Permission
msorder_save(save order)
Step 1. Create the extra field
- Open Extras → MiniShop3 → Utilities → Extra fields.
- In Model class, select msOrder (Orders).
- Click Create field and set:
| Parameter | Value |
|---|---|
| Key | manager_comment |
| Label | Manager comment |
| xtype | textfield |
| dbtype | varchar |
| precision | 500 |
| phptype | string |
| Active | yes |
Save the form. The package runs a migration and adds a column to the orders table.
Class in the database
The UI stores class as MiniShop3\Model\msOrder. Use the same value in the class field when creating via API.
Step 2. Verify via API
GET /api/mgr/extra-fields?class=MiniShop3\Model\msOrderThe list should include manager_comment with "active": true and "column_exists": true.
Step 3. Open the order in the manager
- Extras → MiniShop3 → Orders → pick an order.
- On the order data tab, find Additional order fields.
- Enter text in Manager comment.
- Save the card.
The Vue form sends the value at the top level of the request body:
{
"manager_comment": "Call before delivery"
}Step 4. Confirm persistence
Reload the card or fetch the order:
GET /api/mgr/orders/{id}The response should contain "manager_comment": "Call before delivery".
Extra fields vs model fields
An extra field creates a DB column. Model fields only change how existing columns render (sections, xtype, visible). For new order text, use extra fields.
API appendix
| Method | Path | Permissions |
|---|---|---|
| GET | /api/mgr/extra-fields?class=MiniShop3\Model\msOrder | mssetting_save |
| POST | /api/mgr/extra-fields | mssetting_save |
| PUT | /api/mgr/orders/{id} | msorder_save |
| GET | /api/mgr/orders/{id} | msorder_list |
POST /api/mgr/extra-fields (fragment):
{
"class": "MiniShop3\\Model\\msOrder",
"key": "manager_comment",
"label": "Manager comment",
"xtype": "textfield",
"dbtype": "varchar",
"precision": "500",
"phptype": "string",
"null": true,
"active": true
}Troubleshooting
| Symptom | Check |
|---|---|
| 403 on extra-fields | User policy includes mssetting_save |
| Empty section on the order | active = 1 in ms3_extra_fields, key spelling |
| Field in utility but not on order | Column class in ms3_extra_fields. Form calls GET ...?class=msOrder, DB often has MiniShop3\Model\msOrder. Check DevTools |
| Error after create | MODX log: Phinx migration, write access to core/components/minishop3/migrations |
| Two field systems confuse you | See issue #214 and model fields cookbook |
See also: Extra fields cookbook, Orders.
