Hi @casper-braske,
Thanks for reaching out.
Our developer shared a clue on how a similar integration was implemented for the Dokan PDF Invoice plugin when adapting order actions to the new UI.
The implementation can be reviewed in this pull request: https://github.com/getdokan/dokan/pull/34
You may find it helpful to review the PR itself, especially the Files changed tab, to see exactly how the custom order actions were added and wired into the new UI.
In summary, the solution consists of two parts:
- PHP – Use the
dokan_rest_prepare_shop_order_object filter to add your custom action data to the order REST response. For example, add a URL under a unique key within the actions array. Be sure to merge with existing actions rather than overwrite them.
- JavaScript – Use the
dokan_orders_data_view_dataviews_actions filter (via wp.hooks) to register a corresponding DataViews action. The JS action key should match the key added in PHP and can then perform the desired action (for example, opening a URL in a new tab).
The important thing to note is that the new DataViews-based UI only has access to data exposed through the REST response, so custom actions need to be added to the REST payload first and then registered on the JavaScript side.
The PDF Invoice integration uses this exact pattern to add its “View Invoice” and “View Packing Slip” actions, and it should serve as a useful reference for implementing similar custom actions in your own integration.
Hope this helps!