Trying to add new custom tab at adminhtml_sales_order_view












1














I am working with Magento 1.9.2 and I am rewriting a custom extension trying to add new custom tab at the order view page in the admin panel.



This is the part in the config.xml pointing to the layout file:



<adminhtml>        
<layout>
<updates>
<mageworx_ordersedit>
<file>mageworx_ordersedit.xml</file>
</mageworx_ordersedit>
</updates>
</layout>
<events>
<core_block_abstract_to_html_after>
<observers>
<mw_add_coupon_block>
<type>singleton</type>
<class>mageworx_ordersedit/observer</class>
<method>insertCouponBlock</method>
</mw_add_coupon_block>
</observers>
</core_block_abstract_to_html_after>
</events>
<translate>
<modules>
<MageWorx_OrdersEdit>
<files>
<default>MageWorx_OrdersEdit.csv</default>
</files>
</MageWorx_OrdersEdit>
</modules>
</translate>
</adminhtml>


Here is the content in /app/design/adminhtml/default/default/layout/mageworx_ordersedit.xml



<adminhtml_sales_order_view>
<reference name="head">
<action method="addCss" ifconfig="mageworx_ordersmanagement/ordersedit/enabled"><name>css/mageworx/ordersedit/styles.css</name></action>

<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox.css</name><params/></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox-ie.css</name><params/><if>lt IE 8</if></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js</type><name>mageworx/lightbox/js/lightbox.js</name><params/><if/></action>

<action method="addItem"><type>js</type><name>mageworx/ordersedit/order_edit.js</name><params/><if/></action>

<action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
<action method="addJs"><file>varien/configurable.js</file></action>
</reference>

<!-- Replace standard "Order History" block -->
<block type="mageworx_ordersedit/adminhtml_sales_order_history" name="order_history" template="mageworx/ordersedit/sales-order-view-history.phtml" />
<reference name="order_tab_info">
<action method="unsetChild"><name>order_history</name></action>
<action method="append"><block>order_history</block></action>
</reference>
<!--// Replace standard "Order History" block -->

<reference name="order_items">
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template></action>
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template><type>grouped</type></action>
</reference>

<reference name="content">
<block type="mageworx_ordersedit/adminhtml_sales_order_edit_wrapper" name="oredrspro_js" template="mageworx/ordersedit/edit/wrapper.phtml" />
</reference>

<reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>

</adminhtml_sales_order_view>


I have added this:



    <reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>


Then in: Mageworx/OrdersEdit/Block/Adminhtml/Sales/Order/Edit/Avanspayment.php i have this:



<?php
class Mageworx_OrdersEdit_Block_Adminhtml_Sales_Order_Edit_Avanspayment
extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected $_chat = null;

protected function _construct()
{
parent::_construct();
$this->setTemplate('mageworx/ordersedit/edit/avanspayment.phtml');
}

public function getTabLabel() {
return $this->__('Add New Tab ');
}

public function getTabTitle() {
return $this->__('Add New Tab Title');
}

public function canShowTab() {
return true;
}

public function isHidden() {
return false;
}

public function getOrder(){
return Mage::registry('current_order');
}
}
?>


Then in: /app/design/adminhtml/default/default/template/mageworx/ordersedit/edit/avanspayment.phtml i have added this:



This is custom text to test!


The problem is that nothing appears as new additional tab in the order view page.



Where is my mistake? I see no errors on the orders view page but the tab is not showed either.










share|improve this question
























  • Make sure that you have echo $this->getChildHtml('avanspayment') or echo $this->getChildHtml() inside the reference block template.
    – Siarhey Uchukhlebau
    Aug 7 '16 at 11:33
















1














I am working with Magento 1.9.2 and I am rewriting a custom extension trying to add new custom tab at the order view page in the admin panel.



This is the part in the config.xml pointing to the layout file:



<adminhtml>        
<layout>
<updates>
<mageworx_ordersedit>
<file>mageworx_ordersedit.xml</file>
</mageworx_ordersedit>
</updates>
</layout>
<events>
<core_block_abstract_to_html_after>
<observers>
<mw_add_coupon_block>
<type>singleton</type>
<class>mageworx_ordersedit/observer</class>
<method>insertCouponBlock</method>
</mw_add_coupon_block>
</observers>
</core_block_abstract_to_html_after>
</events>
<translate>
<modules>
<MageWorx_OrdersEdit>
<files>
<default>MageWorx_OrdersEdit.csv</default>
</files>
</MageWorx_OrdersEdit>
</modules>
</translate>
</adminhtml>


Here is the content in /app/design/adminhtml/default/default/layout/mageworx_ordersedit.xml



<adminhtml_sales_order_view>
<reference name="head">
<action method="addCss" ifconfig="mageworx_ordersmanagement/ordersedit/enabled"><name>css/mageworx/ordersedit/styles.css</name></action>

<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox.css</name><params/></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox-ie.css</name><params/><if>lt IE 8</if></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js</type><name>mageworx/lightbox/js/lightbox.js</name><params/><if/></action>

<action method="addItem"><type>js</type><name>mageworx/ordersedit/order_edit.js</name><params/><if/></action>

<action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
<action method="addJs"><file>varien/configurable.js</file></action>
</reference>

<!-- Replace standard "Order History" block -->
<block type="mageworx_ordersedit/adminhtml_sales_order_history" name="order_history" template="mageworx/ordersedit/sales-order-view-history.phtml" />
<reference name="order_tab_info">
<action method="unsetChild"><name>order_history</name></action>
<action method="append"><block>order_history</block></action>
</reference>
<!--// Replace standard "Order History" block -->

<reference name="order_items">
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template></action>
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template><type>grouped</type></action>
</reference>

<reference name="content">
<block type="mageworx_ordersedit/adminhtml_sales_order_edit_wrapper" name="oredrspro_js" template="mageworx/ordersedit/edit/wrapper.phtml" />
</reference>

<reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>

</adminhtml_sales_order_view>


I have added this:



    <reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>


Then in: Mageworx/OrdersEdit/Block/Adminhtml/Sales/Order/Edit/Avanspayment.php i have this:



<?php
class Mageworx_OrdersEdit_Block_Adminhtml_Sales_Order_Edit_Avanspayment
extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected $_chat = null;

protected function _construct()
{
parent::_construct();
$this->setTemplate('mageworx/ordersedit/edit/avanspayment.phtml');
}

public function getTabLabel() {
return $this->__('Add New Tab ');
}

public function getTabTitle() {
return $this->__('Add New Tab Title');
}

public function canShowTab() {
return true;
}

public function isHidden() {
return false;
}

public function getOrder(){
return Mage::registry('current_order');
}
}
?>


Then in: /app/design/adminhtml/default/default/template/mageworx/ordersedit/edit/avanspayment.phtml i have added this:



This is custom text to test!


The problem is that nothing appears as new additional tab in the order view page.



Where is my mistake? I see no errors on the orders view page but the tab is not showed either.










share|improve this question
























  • Make sure that you have echo $this->getChildHtml('avanspayment') or echo $this->getChildHtml() inside the reference block template.
    – Siarhey Uchukhlebau
    Aug 7 '16 at 11:33














1












1








1


1





I am working with Magento 1.9.2 and I am rewriting a custom extension trying to add new custom tab at the order view page in the admin panel.



This is the part in the config.xml pointing to the layout file:



<adminhtml>        
<layout>
<updates>
<mageworx_ordersedit>
<file>mageworx_ordersedit.xml</file>
</mageworx_ordersedit>
</updates>
</layout>
<events>
<core_block_abstract_to_html_after>
<observers>
<mw_add_coupon_block>
<type>singleton</type>
<class>mageworx_ordersedit/observer</class>
<method>insertCouponBlock</method>
</mw_add_coupon_block>
</observers>
</core_block_abstract_to_html_after>
</events>
<translate>
<modules>
<MageWorx_OrdersEdit>
<files>
<default>MageWorx_OrdersEdit.csv</default>
</files>
</MageWorx_OrdersEdit>
</modules>
</translate>
</adminhtml>


Here is the content in /app/design/adminhtml/default/default/layout/mageworx_ordersedit.xml



<adminhtml_sales_order_view>
<reference name="head">
<action method="addCss" ifconfig="mageworx_ordersmanagement/ordersedit/enabled"><name>css/mageworx/ordersedit/styles.css</name></action>

<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox.css</name><params/></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox-ie.css</name><params/><if>lt IE 8</if></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js</type><name>mageworx/lightbox/js/lightbox.js</name><params/><if/></action>

<action method="addItem"><type>js</type><name>mageworx/ordersedit/order_edit.js</name><params/><if/></action>

<action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
<action method="addJs"><file>varien/configurable.js</file></action>
</reference>

<!-- Replace standard "Order History" block -->
<block type="mageworx_ordersedit/adminhtml_sales_order_history" name="order_history" template="mageworx/ordersedit/sales-order-view-history.phtml" />
<reference name="order_tab_info">
<action method="unsetChild"><name>order_history</name></action>
<action method="append"><block>order_history</block></action>
</reference>
<!--// Replace standard "Order History" block -->

<reference name="order_items">
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template></action>
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template><type>grouped</type></action>
</reference>

<reference name="content">
<block type="mageworx_ordersedit/adminhtml_sales_order_edit_wrapper" name="oredrspro_js" template="mageworx/ordersedit/edit/wrapper.phtml" />
</reference>

<reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>

</adminhtml_sales_order_view>


I have added this:



    <reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>


Then in: Mageworx/OrdersEdit/Block/Adminhtml/Sales/Order/Edit/Avanspayment.php i have this:



<?php
class Mageworx_OrdersEdit_Block_Adminhtml_Sales_Order_Edit_Avanspayment
extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected $_chat = null;

protected function _construct()
{
parent::_construct();
$this->setTemplate('mageworx/ordersedit/edit/avanspayment.phtml');
}

public function getTabLabel() {
return $this->__('Add New Tab ');
}

public function getTabTitle() {
return $this->__('Add New Tab Title');
}

public function canShowTab() {
return true;
}

public function isHidden() {
return false;
}

public function getOrder(){
return Mage::registry('current_order');
}
}
?>


Then in: /app/design/adminhtml/default/default/template/mageworx/ordersedit/edit/avanspayment.phtml i have added this:



This is custom text to test!


The problem is that nothing appears as new additional tab in the order view page.



Where is my mistake? I see no errors on the orders view page but the tab is not showed either.










share|improve this question















I am working with Magento 1.9.2 and I am rewriting a custom extension trying to add new custom tab at the order view page in the admin panel.



This is the part in the config.xml pointing to the layout file:



<adminhtml>        
<layout>
<updates>
<mageworx_ordersedit>
<file>mageworx_ordersedit.xml</file>
</mageworx_ordersedit>
</updates>
</layout>
<events>
<core_block_abstract_to_html_after>
<observers>
<mw_add_coupon_block>
<type>singleton</type>
<class>mageworx_ordersedit/observer</class>
<method>insertCouponBlock</method>
</mw_add_coupon_block>
</observers>
</core_block_abstract_to_html_after>
</events>
<translate>
<modules>
<MageWorx_OrdersEdit>
<files>
<default>MageWorx_OrdersEdit.csv</default>
</files>
</MageWorx_OrdersEdit>
</modules>
</translate>
</adminhtml>


Here is the content in /app/design/adminhtml/default/default/layout/mageworx_ordersedit.xml



<adminhtml_sales_order_view>
<reference name="head">
<action method="addCss" ifconfig="mageworx_ordersmanagement/ordersedit/enabled"><name>css/mageworx/ordersedit/styles.css</name></action>

<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox.css</name><params/></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js_css</type><name>mageworx/lightbox/css/lightbox-ie.css</name><params/><if>lt IE 8</if></action>
<action method="addItem" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><type>js</type><name>mageworx/lightbox/js/lightbox.js</name><params/><if/></action>

<action method="addItem"><type>js</type><name>mageworx/ordersedit/order_edit.js</name><params/><if/></action>

<action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>
<action method="addJs"><file>varien/configurable.js</file></action>
</reference>

<!-- Replace standard "Order History" block -->
<block type="mageworx_ordersedit/adminhtml_sales_order_history" name="order_history" template="mageworx/ordersedit/sales-order-view-history.phtml" />
<reference name="order_tab_info">
<action method="unsetChild"><name>order_history</name></action>
<action method="append"><block>order_history</block></action>
</reference>
<!--// Replace standard "Order History" block -->

<reference name="order_items">
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template></action>
<action method="addColumnRender" ifconfig="mageworx_ordersmanagement/ordersedit/show_thumbnails"><column>name</column><block>adminhtml/sales_items_column_name_grouped</block><template>mageworx/ordersedit/sales-items-column-name.phtml</template><type>grouped</type></action>
</reference>

<reference name="content">
<block type="mageworx_ordersedit/adminhtml_sales_order_edit_wrapper" name="oredrspro_js" template="mageworx/ordersedit/edit/wrapper.phtml" />
</reference>

<reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>

</adminhtml_sales_order_view>


I have added this:



    <reference name="avanspayment">
<action method="addTab">
<name>mageworx_ordersedit_sales_order_edit_avanspayment</name>
<block>mageworx_ordersedit/adminhtml_sales_order_edit_avanspayment</block>
</action>
</reference>


Then in: Mageworx/OrdersEdit/Block/Adminhtml/Sales/Order/Edit/Avanspayment.php i have this:



<?php
class Mageworx_OrdersEdit_Block_Adminhtml_Sales_Order_Edit_Avanspayment
extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected $_chat = null;

protected function _construct()
{
parent::_construct();
$this->setTemplate('mageworx/ordersedit/edit/avanspayment.phtml');
}

public function getTabLabel() {
return $this->__('Add New Tab ');
}

public function getTabTitle() {
return $this->__('Add New Tab Title');
}

public function canShowTab() {
return true;
}

public function isHidden() {
return false;
}

public function getOrder(){
return Mage::registry('current_order');
}
}
?>


Then in: /app/design/adminhtml/default/default/template/mageworx/ordersedit/edit/avanspayment.phtml i have added this:



This is custom text to test!


The problem is that nothing appears as new additional tab in the order view page.



Where is my mistake? I see no errors on the orders view page but the tab is not showed either.







adminhtml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Kirti Nariya

975314




975314










asked Aug 1 '16 at 13:37









Venelin Vasilev

59232552




59232552












  • Make sure that you have echo $this->getChildHtml('avanspayment') or echo $this->getChildHtml() inside the reference block template.
    – Siarhey Uchukhlebau
    Aug 7 '16 at 11:33


















  • Make sure that you have echo $this->getChildHtml('avanspayment') or echo $this->getChildHtml() inside the reference block template.
    – Siarhey Uchukhlebau
    Aug 7 '16 at 11:33
















Make sure that you have echo $this->getChildHtml('avanspayment') or echo $this->getChildHtml() inside the reference block template.
– Siarhey Uchukhlebau
Aug 7 '16 at 11:33




Make sure that you have echo $this->getChildHtml('avanspayment') or echo $this->getChildHtml() inside the reference block template.
– Siarhey Uchukhlebau
Aug 7 '16 at 11:33










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f128422%2ftrying-to-add-new-custom-tab-at-adminhtml-sales-order-view%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f128422%2ftrying-to-add-new-custom-tab-at-adminhtml-sales-order-view%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1300-talet

1300-talet

Display a custom attribute below product name in the front-end Magento 1.9.3.8