1

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)

0

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 agree to our terms of service, privacy policy and cookie policy

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