<p>I found the solution in another question:
<a href="https://craftcms.stackexchange.com/questions/23721/writing-a-plugin-that-triggers-on-a-control-panel-template-hook?rq=1">Writing a plugin that triggers on a Control Panel Template Hook?</a></p>

<p>Based on this answer we can use:</p>

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

CC BY-SA 4.0
2018-09-12T13:15:35.740Z
2018-09-12T13:15:35.740Z
Tom Deleu
<p>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)</p>

<plugin-craftcommerce>
Extend a Commerce (v2) order template in the control panel
# Extend a Commerce (v2) order template in the control panel

(Asked by: username_0 on 2018-08-26)

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)

**Tags:** plugin-craftcommerce

---

## 1 answers

### Answer by username_0 on 2018-09-12. Score: 1 | Accepted answer

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 'My Button!';
});


---

