Skip to content

Add plugin cards and columns to orders

Return contributor objects from getAdminOrderContributors():

Provider method
public array function getAdminOrderContributors() {
return [new netseller_plugin_example_hello.services.order_contributor()];
}

Your CFC can implement either or both callbacks. Each returns an array; return [] when the contribution is not relevant or the current user must not see it. Protect any action route separately.

buildAdminOrderDetailCardContributions(context) receives context.datasource and context.order. Return cards with these fields:

Field Type Meaning
id string Required stable identifier.
title, description string Required display text; translate before returning.
sortOrder number Optional display order.
metaText string Optional secondary text.
action struct Optional action definition below.

An action contains required label, routeName and method (GET or POST), optional routeParams (struct) and buttonStyle (primary or outline-primary).

One returned card
{
'id' = "example.hello.order",
'sortOrder' = 100,
'title' = "Hello",
'description' = "Open the plugin settings.",
'action' = {
'label' = "Open",
'routeName' = "plugin.example.hello.index",
'routeParams' = {},
'method' = "GET",
'buttonStyle' = "outline-primary"
},
'metaText' = ""
}

The shared renderer builds the URL and markup. For POST actions it supplies CSRF and disables duplicate submissions while navigating. Return data, not custom card HTML.

buildAdminOrderListColumnContributions(context) receives context.datasource and context.orders. Return a column with required id and label, optional sortOrder, and cells, a struct keyed by order ID.

One returned column
{
'id' = "example.hello.status",
'label' = "Hello",
'sortOrder' = 100,
'cells' = {
'123' = {
'icon' = "check",
'color' = "success",
'tooltip' = "Exported",
'routeName' = "plugin.example.hello.index",
'routeParams' = {}
}
}
}

The ID 123 is illustrative: build entries from the supplied orders and your plugin’s own mappings. Missing cells are empty. Use primary, success or secondary for cell colour. Omit a route for a non-clickable state.

The bexio integration uses these two surfaces for export actions and export status. Read order contents through the public snapshot service and store external IDs in plugin-owned tables.