Modify Order table in Control Panel I need to add and/or change an attribute in the order table on /admin/commerce/orders.

The Order Element itself does not have a EVENT_SET_TABLE_ATTRIBUTE_HTML, and I've tried with variations like this:

public function init()
{
    parent::init();
    Event::on(Element::class, Element::EVENT_SET_TABLE_ATTRIBUTE_HTML,[$this, 'setOrderStatusTableAttributeHtml']);
}

public function setOrderStatusTableAttributeHtml($event, $attribute)
{
    if ($event-&gt;element instanceof \craft\commerce\elements\Order &amp;&amp; $attribute == 'orderStatus') {
        return 'Changed';
    }
}


The event does not show up in the debug bar. I've also tried a EVENT_INIT with die('died') an that kills the execution, so my plugin is installed and loading.
I solved this by overriding the routes set by craft commerce and extend the OrderController and the Order element.

This is not a good solution (I'm going upload this as a plugin) and if several plugins overwrite the same route, only the latest plugin will work.

If anyone have a proper solution I'll accept that. I'll leave this answer here in the meantime.

Plugin::init()

    Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, function (RegisterUrlRulesEvent $event) {
        $event-&gt;rules['commerce/orders'] = 'commerce-easy-order-management/orders/order-index';
        $event-&gt;rules['commerce/orders/&lt;orderId:\d+&gt;'] = 'commerce-easy-order-management/orders/edit-order';
        $event-&gt;rules['commerce/orders/action/&lt;orderId:\d+&gt;'] = 'commerce-easy-order-management/orders/order-action';
    });


controllers\OrdersController

class OrdersController extends \craft\commerce\controllers\OrdersController
{
    /**
     * Index of Orders
     * Overwriting commerce/controllers/OrderController::actionOrderIndex()
     *
     * @return Response
     * @throws \Throwable
     */
    public function actionOrderIndex(): Response
    {
        // Remove all incomplete carts older than a certain date in config.
        Plugin::getInstance()-&gt;getCarts()-&gt;purgeIncompleteCarts();

        Craft::$app-&gt;view-&gt;registerCssFile('https://use.fontawesome.com/releases/v5.3.1/css/all.css');

        return $this-&gt;renderTemplate('commerce-easy-order-management/orders/_index');
    }
}


elements\Order

class Order extends \craft\commerce\elements\Order
{
    /**
     * @inheritdoc
     */
    public function getTableAttributeHtml(string $attribute): string
    {
        if($attribute !== 'orderActions') return parent::getTableAttributeHtml($attribute);
        return 'MyActionHTML';
    }

    /**
     * @inheritdoc
     */
    protected static function defineTableAttributes(): array
    {
        $attributes = parent::defineTableAttributes();
        $attributes['orderActions'] = ['label' =&gt; Craft::t('commerce', 'Actions')];
        return $attributes;
    }
}


templates/orders/_index.html

{% extends "_layouts/elementindex" %}

{% set title = "Orders"|t('commerce') %}
{% set docTitle = title~' - '~'Commerce' %}
{% set elementType = 'MY_NAMESPACE\\elements\\Order' %} 
{% set selectedTab = 'orders' %}
{% set selectedSubnavItem = "orders" %}
{% set bodyClass = (bodyClass is defined ? bodyClass~' ' : '') ~ "commerceorders     commerceordersindex" %}

{% do craft.app.view.registerTranslations('commerce', [
    "Total Revenue",
    "Last 7 days",
    "Last 30 days",
    "Last Week",
    "Last Month",
    "Custom Range",
    "Apply"
]) %}