You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/migrating-from-simple-commerce.md
-5Lines changed: 0 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,11 +160,6 @@ Since orders are no longer stored in collections, Cargo provides its own "Order"
160
160
161
161
During the migration process, Cargo will have attempted to copy across any custom fields you added to the order collection's blueprint.
162
162
163
-
### Status Log
164
-
The "Status Log" feature present in Simple Commerce doesn't exist in Cargo. Cargo simply displays the current status of orders.
165
-
166
-
If you need to occasionally reference the history of order statuses, you may wish to take advantage of [Statamic's Git Automation](https://statamic.dev/git-automation) if you're storing orders in flat files, or use a package like [`spatie/laravel-activitylog`](https://github.com/spatie/laravel-activitylog) if you're using a database.
167
-
168
163
## Customers
169
164
By default, Simple Commerce stored information about your customers in a customers collection or `customers` database table.
The Timeline feature provides a complete audit trail of order changes, visible when viewing orders in the Control Panel. It automatically tracks key events including:
41
+
42
+
- Order creation and updates
43
+
- Status changes
44
+
- Refunds
45
+
46
+
Each event records the authenticated user who made the change and any relevant metadata.
47
+
48
+

49
+
50
+
### Custom Timeline Events
51
+
You can extend the Timeline by registering custom event types to track additional order activities beyond the built-in events.
52
+
53
+
Create a PHP class that extends `TimelineEventType` to represent your custom event:
54
+
55
+
```php
56
+
// app/TimelineEventTypes/OrderDelivered.php
57
+
58
+
use DuncanMcClean\Cargo\Orders\TimelineEventType;
59
+
60
+
class OrderDelivered extends TimelineEventType
61
+
{
62
+
public function message() : string
63
+
{
64
+
return "Order Delivered by Royal Mail";
65
+
}
66
+
}
67
+
```
68
+
69
+
Register your custom event type in your `AppServiceProvider`:
70
+
71
+
```php
72
+
// app/Providers/AppServiceProvider.php
73
+
74
+
public function boot(): void
75
+
{
76
+
OrderDelivered::register();
77
+
}
78
+
```
79
+
80
+
Then listen for the relevant event in your application and append your custom timeline event to the order:
Out of the box, orders are stored as YAML files in the `content/cargo/orders` directory. If you wish, you can change the directory in the `cargo.php` config file:
0 commit comments