Installation

Requirements

  • Craft CMS 5.0 or later
  • Craft Commerce 5.0 or later
  • PHP 8.2 or later

Install using Composer

# go to the project directory
cd /path/to/my-project

# tell Composer to load the plugin
composer require johnhenry/craft-order-lifecycle

# tell Craft to install the plugin
./craft plugin/install order-lifecycle

Install using DDEV

ddev composer require "johnhenry/craft-order-lifecycle:^1.0.0" -w && ddev craft plugin/install order-lifecycle

Install from the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Order Lifecycle”. Then press “Install”.

Post-Installation

Once it's installed, most event tracking starts straight away - no extra configuration needed. One event (checkout started) needs a small template change, covered below.

Create and Add the Order Lifecycle Field

The timeline is a custom field type, so first you need a field using it, added to your order field layout. See Field Type for the full step-by-step.

Enable Checkout Tracking

Nearly every event on the timeline is logged automatically - but not checkoutStarted. Craft Commerce doesn't fire a native event when a customer lands on the checkout page, so you need to add this yourself, somewhere in your checkout flow:

{# Example only - add this wherever your checkout flow actually lives #}
{% set cart = craft.commerce.carts.cart %}
{% if cart and cart.email %}
  {% do craft.orderLifecycle.logCheckoutStarted(cart) %}
{% endif %}

This is just an example of the pattern, not a fixed location. "Checkout template" is shorthand - your setup might call it something else entirely (an address step, a cart index template, a single-page checkout partial), so add the tag wherever the customer first commits to checking out in your build.

Skip this and the timeline will simply never show a "Customer visited checkout" entry - nothing else breaks, but that piece of the picture is missing. See Event Tracking for the PHP equivalent and more detail.

Verify Installation

  1. Go to CommerceOrders
  2. Open any order
  3. You should see the Order Lifecycle field with a timeline (may be empty for orders created before installation)

What's Next?