2

I am developing custom plugin, in which i'm adding note in customer information data from Manage customer. I also want to show that note in order with customer information. I need to override one file

design/adminhtml/default/default/template/sales/order/view/info.phtml 

My config file is

    <?xml version="1.0" ?>
<config>
  <modules>
    <Company_Module>
      <version>1.0.0.1</version>
    </Company_Module>
  </modules>
  <global>
    <blocks>
      <module>
        <class>Company_Module_Block</class>
      </module>
      <adminhtml>
        <rewrite>
         <customer_grid>Company_Module_Block_Adminhtml_Customer_Grid</customer_grid>
        </rewrite>
        <rewrite>
        <sales_order_view_info>Company_Module_Block_Sales_Order_View_Info</sales_order_view_info>
        </rewrite>
     </adminhtml>
    </blocks>
    <models>
      <module>
        <class>Company_Module_Model</class>
        <resourceModel>module_mysql4</resourceModel>
      </module>
    </models>
    <resources>
      <module_setup>
        <setup>
          <module>Company_Module</module>
          <class>Company_Module_Model_Mysql4_Setup</class>
        </setup>
      </module_setup>
    </resources>
  </global>
  <adminhtml>
    <layout>
      <updates>
        <module>
          <file>module.xml</file>
        </module>
      </updates>
    </layout>
    <events>
      <adminhtml_customer_save_after>
        <observers>
          <module>
            <type>singleton</type>
            <class>Company_Module_Model_Observer</class>
            <method>saveCustomerTabData</method>
          </module>
        </observers>
      </adminhtml_customer_save_after>
    </events>
  </adminhtml>
</config>

And Block file is app/local/Company/Module/Block/Sales/Order/View/Info.php

<?php

class Company_Module_Block_Sales_Order_View_Info extends Mage_Adminhtml_Block_Sales_Order_View_Info
{
    public function __construct()
    {


        $this->setTemplate('module/sales/order/view/info.phtml');
        echo $this->getTemplate(); //correct path showing 


    }

    public function getCommentCustomer($orderID)
    {
        $customer = Mage::getModel('customer/customer')->load($orderID);
        return $customer->getComment(); // comment i have added from tab
    }
}

I am using template hint extension. Its showing correct Correct Block but showing wrong .phtml path. Instead of module/sales/order/view/info.phtml it shows /adminhtml/default/default/template/sales/order/view/info.phtml

Thanks in advance.

1 Answer 1

2

You can follow two tutorial, this will be help you.

How to overwrite sales view order phtml file in magento

How to add custom block after items block into order view page in magento

3
  • It worked , but i don't know why my code didn't worked. I changed only module.xml and Info.php file Commented Apr 24, 2014 at 8:38
  • Links are no more working Commented Dec 16, 2020 at 15:07
  • Modified the link @AkshayPrabhakar
    – Sohel Rana
    Commented Dec 17, 2020 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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