Is there a way to extend (extend, not replace) the default Commerce order templates in the control panel? I'd like to display important custom fields in a prominent way on the first tab. (and not tucked away on a second tab as is normal with custom fields)


I found the solution in another question: Writing a plugin that triggers on a Control Panel Template Hook?

Based on this answer we can use:

Craft::$app->getView()->hook('cp.commerce.order.edit.main-pane', function(array &$context) {
    return '<a href="#" class="btn">My Button!</a>';

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.