Simple Observer not workingMagento add new Button on Sales order viewAppend block to admin login formObserver...

Can I make estimated tax payments instead of withholding from my paycheck?

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?

Cat is tipping over bed-side lamps during the night

What is the difference between rolling more dice versus fewer dice?

Making him into a bully (how to show mild violence)

Words and Words with "ver-" Prefix

What would be the rarity of this magic item(s)?

What to look for when criticizing poetry?

Absorbing damage with Planeswalker

using 'echo' & 'printf' in bash function calls

Why is Agricola named as such?

Graph with overlapping labels

How should I handle players who ignore the session zero agreement?

Using only 1s, make 29 with the minimum number of digits

Why publish a research paper when a blog post or a lecture slide can have more citation count than a journal paper?

Is using an 'empty' metaphor considered bad style?

Why exactly do action photographers need high fps burst cameras?

Quickly creating a sparse array

Am I a Rude Number?

What are the exceptions to Natural Selection?

How do I append a character to the end of every line in an Excel cell?

Removing disk while game is suspended

Why did Luke use his left hand to shoot?

Gear reduction on large turbofans



Simple Observer not working


Magento add new Button on Sales order viewAppend block to admin login formObserver not workingAdding button to Adminhtml Order View (guides followed not working)Observer not firing - adminhtml_block_html_beforeMagento 2 Simple Model Observer not workingSimple event observer not working inSimple controller not workingSimple Observer not firing on eventEvent observer not workingForm is not displayed on panel admin Magento 2













0















I'm new to Magento and I'm trying to add an additional button to a pre-existing admin form using an observer. I set up my config to what I believe is the right event handle. I created an observer and added the name and method to config. I don't believe my observer is ever hit since Mage log is not printing. Can anyone see where I'm going wrong?



Sales.xml - (Enterprise layout file)



<layout>
<adminhtml_sales_order_view>
<reference name="content">
<block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
</reference>
</adminhtml_sales_order_view>
</layout>


config.xml



<?xml version="1.0" encoding="UTF-8"?>

<config>
<modules>
<Mycompany_MyModule>
<version>0.1.0</version>
</Mycompany_MyModule>
</modules>
<global>
<events>
<adminhtml_sales_order_view>
<observers>
<my_observer>
<type>singleton</type>
<class>Mycompany_MyModule_Model_Observer</class>
<method>addMyButton</method>
</my_observer>
</observers>
</adminhtml_sales_order_view>
</events>
</global>
</config>


Observer.php



<?php

class Mycompany_MyModule_Model_Observer
{
public function addMyButton($observer)
{
Mage::log('test observer');

$container = $observer->getBlock();
if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')
{
$data = array(
'label' => 'My button',
'class' => 'go',
'onclick' => 'setLocation(' ' . Mage::getUrl('*/*', array('param' => 'value')) . '')',
);
$container->addButton('my_button_identifier', $data);
}
return $this;
}
}









share|improve this question





























    0















    I'm new to Magento and I'm trying to add an additional button to a pre-existing admin form using an observer. I set up my config to what I believe is the right event handle. I created an observer and added the name and method to config. I don't believe my observer is ever hit since Mage log is not printing. Can anyone see where I'm going wrong?



    Sales.xml - (Enterprise layout file)



    <layout>
    <adminhtml_sales_order_view>
    <reference name="content">
    <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
    </reference>
    </adminhtml_sales_order_view>
    </layout>


    config.xml



    <?xml version="1.0" encoding="UTF-8"?>

    <config>
    <modules>
    <Mycompany_MyModule>
    <version>0.1.0</version>
    </Mycompany_MyModule>
    </modules>
    <global>
    <events>
    <adminhtml_sales_order_view>
    <observers>
    <my_observer>
    <type>singleton</type>
    <class>Mycompany_MyModule_Model_Observer</class>
    <method>addMyButton</method>
    </my_observer>
    </observers>
    </adminhtml_sales_order_view>
    </events>
    </global>
    </config>


    Observer.php



    <?php

    class Mycompany_MyModule_Model_Observer
    {
    public function addMyButton($observer)
    {
    Mage::log('test observer');

    $container = $observer->getBlock();
    if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')
    {
    $data = array(
    'label' => 'My button',
    'class' => 'go',
    'onclick' => 'setLocation(' ' . Mage::getUrl('*/*', array('param' => 'value')) . '')',
    );
    $container->addButton('my_button_identifier', $data);
    }
    return $this;
    }
    }









    share|improve this question



























      0












      0








      0








      I'm new to Magento and I'm trying to add an additional button to a pre-existing admin form using an observer. I set up my config to what I believe is the right event handle. I created an observer and added the name and method to config. I don't believe my observer is ever hit since Mage log is not printing. Can anyone see where I'm going wrong?



      Sales.xml - (Enterprise layout file)



      <layout>
      <adminhtml_sales_order_view>
      <reference name="content">
      <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
      </reference>
      </adminhtml_sales_order_view>
      </layout>


      config.xml



      <?xml version="1.0" encoding="UTF-8"?>

      <config>
      <modules>
      <Mycompany_MyModule>
      <version>0.1.0</version>
      </Mycompany_MyModule>
      </modules>
      <global>
      <events>
      <adminhtml_sales_order_view>
      <observers>
      <my_observer>
      <type>singleton</type>
      <class>Mycompany_MyModule_Model_Observer</class>
      <method>addMyButton</method>
      </my_observer>
      </observers>
      </adminhtml_sales_order_view>
      </events>
      </global>
      </config>


      Observer.php



      <?php

      class Mycompany_MyModule_Model_Observer
      {
      public function addMyButton($observer)
      {
      Mage::log('test observer');

      $container = $observer->getBlock();
      if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')
      {
      $data = array(
      'label' => 'My button',
      'class' => 'go',
      'onclick' => 'setLocation(' ' . Mage::getUrl('*/*', array('param' => 'value')) . '')',
      );
      $container->addButton('my_button_identifier', $data);
      }
      return $this;
      }
      }









      share|improve this question
















      I'm new to Magento and I'm trying to add an additional button to a pre-existing admin form using an observer. I set up my config to what I believe is the right event handle. I created an observer and added the name and method to config. I don't believe my observer is ever hit since Mage log is not printing. Can anyone see where I'm going wrong?



      Sales.xml - (Enterprise layout file)



      <layout>
      <adminhtml_sales_order_view>
      <reference name="content">
      <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
      </reference>
      </adminhtml_sales_order_view>
      </layout>


      config.xml



      <?xml version="1.0" encoding="UTF-8"?>

      <config>
      <modules>
      <Mycompany_MyModule>
      <version>0.1.0</version>
      </Mycompany_MyModule>
      </modules>
      <global>
      <events>
      <adminhtml_sales_order_view>
      <observers>
      <my_observer>
      <type>singleton</type>
      <class>Mycompany_MyModule_Model_Observer</class>
      <method>addMyButton</method>
      </my_observer>
      </observers>
      </adminhtml_sales_order_view>
      </events>
      </global>
      </config>


      Observer.php



      <?php

      class Mycompany_MyModule_Model_Observer
      {
      public function addMyButton($observer)
      {
      Mage::log('test observer');

      $container = $observer->getBlock();
      if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')
      {
      $data = array(
      'label' => 'My button',
      'class' => 'go',
      'onclick' => 'setLocation(' ' . Mage::getUrl('*/*', array('param' => 'value')) . '')',
      );
      $container->addButton('my_button_identifier', $data);
      }
      return $this;
      }
      }






      event-observer adminhtml magento-1 forms






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 12 '16 at 9:10









      Siarhey Uchukhlebau

      9,79192858




      9,79192858










      asked Aug 12 '16 at 3:38









      ThisBetterWorkThisBetterWork

      1084




      1084






















          4 Answers
          4






          active

          oldest

          votes


















          0














          You need to extend layout instead of writing observer.
          You cannot dispatch a new event using layout files. Please check more on how to extend layout handles






          share|improve this answer
























          • Right, I see. I was kind of merging the layout update and observer ideas together. I will check this out now. Thanks.

            – ThisBetterWork
            Aug 12 '16 at 4:15



















          0














          There is no event with the name <adminhtml_sales_order_view>, it is a layout handle.

          You need to use event like <core_block_abstract_prepare_layout_before> as below :



          <adminhtml>
          <events>
          <core_block_abstract_prepare_layout_before>
          <observers>
          .....
          </observers>
          </core_block_abstract_prepare_layout_before>
          </events>
          </adminhtml>


          Reference Links :




          • http://inchoo.net/category/magento/events-observers/


          • https://www.nicksays.co.uk/magento-events-cheat-sheet-1-9/


          • Magento add new Button on Sales order view







          share|improve this answer


























          • Thank you for pointing this out. I can't tell if there's a good event that would allow me to append to this admin form. I'm going to checkout layout update, but appreciate your explanation for clarity.

            – ThisBetterWork
            Aug 12 '16 at 4:18



















          0














          FINAL CODE - I did a layout update and it worked for me.



          config.xml



          <?xml version="1.0" encoding="UTF-8"?>
          <config>
          <modules>
          <MyCompany_MyModule>
          <version>0.1.0</version>
          </MyCompany_MyModule>
          </modules>
          <adminhtml>
          <layout>
          <updates>
          <myupdate>
          <file>myupdate.xml</file>
          </myupdate>
          </updates>
          </layout>
          </adminhtml>
          </config>


          myupdate.xml



          <layout version="0.1.0">
          <adminhtml_sales_order_view>
          <reference name="sales_order_edit">
          <action method="addButton">
          <id>my_button_identifier</id>
          <data>
          <label>My button</label>
          <class>go</class>
          </data>
          </action>
          </reference>
          </adminhtml_sales_order_view>
          </layout>





          share|improve this answer































            0














            Have you defined your <blocks> and <models> within config.xml? If you didnt define models, that will explain why your observer didn't work. Well, that, and the fact that you have a layout handle as your event.



            Additionally, instead of



            if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')


            you should go with



            if($container instanceof Mage_Adminhtml_Block_Sales_Order_View)


            That's because if you have some module or customization in the future, the "type" may change but it will most likely still extend from the original class.



            Additionally, a super helpful tool created by Alan Storm, Commerce Bug. I use it every single day. In fact, it will provide you with a list of available observer events available on a given page.



            Also, xdebug is very helpful when debugging Magento. You will know right away if your observer is firing. I made a short video on how to install xdebug. Xdebug Installation






            share|improve this answer

























              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%2f131158%2fsimple-observer-not-working%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              You need to extend layout instead of writing observer.
              You cannot dispatch a new event using layout files. Please check more on how to extend layout handles






              share|improve this answer
























              • Right, I see. I was kind of merging the layout update and observer ideas together. I will check this out now. Thanks.

                – ThisBetterWork
                Aug 12 '16 at 4:15
















              0














              You need to extend layout instead of writing observer.
              You cannot dispatch a new event using layout files. Please check more on how to extend layout handles






              share|improve this answer
























              • Right, I see. I was kind of merging the layout update and observer ideas together. I will check this out now. Thanks.

                – ThisBetterWork
                Aug 12 '16 at 4:15














              0












              0








              0







              You need to extend layout instead of writing observer.
              You cannot dispatch a new event using layout files. Please check more on how to extend layout handles






              share|improve this answer













              You need to extend layout instead of writing observer.
              You cannot dispatch a new event using layout files. Please check more on how to extend layout handles







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Aug 12 '16 at 3:58









              shabbirshabbir

              18510




              18510













              • Right, I see. I was kind of merging the layout update and observer ideas together. I will check this out now. Thanks.

                – ThisBetterWork
                Aug 12 '16 at 4:15



















              • Right, I see. I was kind of merging the layout update and observer ideas together. I will check this out now. Thanks.

                – ThisBetterWork
                Aug 12 '16 at 4:15

















              Right, I see. I was kind of merging the layout update and observer ideas together. I will check this out now. Thanks.

              – ThisBetterWork
              Aug 12 '16 at 4:15





              Right, I see. I was kind of merging the layout update and observer ideas together. I will check this out now. Thanks.

              – ThisBetterWork
              Aug 12 '16 at 4:15













              0














              There is no event with the name <adminhtml_sales_order_view>, it is a layout handle.

              You need to use event like <core_block_abstract_prepare_layout_before> as below :



              <adminhtml>
              <events>
              <core_block_abstract_prepare_layout_before>
              <observers>
              .....
              </observers>
              </core_block_abstract_prepare_layout_before>
              </events>
              </adminhtml>


              Reference Links :




              • http://inchoo.net/category/magento/events-observers/


              • https://www.nicksays.co.uk/magento-events-cheat-sheet-1-9/


              • Magento add new Button on Sales order view







              share|improve this answer


























              • Thank you for pointing this out. I can't tell if there's a good event that would allow me to append to this admin form. I'm going to checkout layout update, but appreciate your explanation for clarity.

                – ThisBetterWork
                Aug 12 '16 at 4:18
















              0














              There is no event with the name <adminhtml_sales_order_view>, it is a layout handle.

              You need to use event like <core_block_abstract_prepare_layout_before> as below :



              <adminhtml>
              <events>
              <core_block_abstract_prepare_layout_before>
              <observers>
              .....
              </observers>
              </core_block_abstract_prepare_layout_before>
              </events>
              </adminhtml>


              Reference Links :




              • http://inchoo.net/category/magento/events-observers/


              • https://www.nicksays.co.uk/magento-events-cheat-sheet-1-9/


              • Magento add new Button on Sales order view







              share|improve this answer


























              • Thank you for pointing this out. I can't tell if there's a good event that would allow me to append to this admin form. I'm going to checkout layout update, but appreciate your explanation for clarity.

                – ThisBetterWork
                Aug 12 '16 at 4:18














              0












              0








              0







              There is no event with the name <adminhtml_sales_order_view>, it is a layout handle.

              You need to use event like <core_block_abstract_prepare_layout_before> as below :



              <adminhtml>
              <events>
              <core_block_abstract_prepare_layout_before>
              <observers>
              .....
              </observers>
              </core_block_abstract_prepare_layout_before>
              </events>
              </adminhtml>


              Reference Links :




              • http://inchoo.net/category/magento/events-observers/


              • https://www.nicksays.co.uk/magento-events-cheat-sheet-1-9/


              • Magento add new Button on Sales order view







              share|improve this answer















              There is no event with the name <adminhtml_sales_order_view>, it is a layout handle.

              You need to use event like <core_block_abstract_prepare_layout_before> as below :



              <adminhtml>
              <events>
              <core_block_abstract_prepare_layout_before>
              <observers>
              .....
              </observers>
              </core_block_abstract_prepare_layout_before>
              </events>
              </adminhtml>


              Reference Links :




              • http://inchoo.net/category/magento/events-observers/


              • https://www.nicksays.co.uk/magento-events-cheat-sheet-1-9/


              • Magento add new Button on Sales order view








              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 13 '17 at 12:54









              Community

              1




              1










              answered Aug 12 '16 at 4:01









              Anshu MishraAnshu Mishra

              5,33252660




              5,33252660













              • Thank you for pointing this out. I can't tell if there's a good event that would allow me to append to this admin form. I'm going to checkout layout update, but appreciate your explanation for clarity.

                – ThisBetterWork
                Aug 12 '16 at 4:18



















              • Thank you for pointing this out. I can't tell if there's a good event that would allow me to append to this admin form. I'm going to checkout layout update, but appreciate your explanation for clarity.

                – ThisBetterWork
                Aug 12 '16 at 4:18

















              Thank you for pointing this out. I can't tell if there's a good event that would allow me to append to this admin form. I'm going to checkout layout update, but appreciate your explanation for clarity.

              – ThisBetterWork
              Aug 12 '16 at 4:18





              Thank you for pointing this out. I can't tell if there's a good event that would allow me to append to this admin form. I'm going to checkout layout update, but appreciate your explanation for clarity.

              – ThisBetterWork
              Aug 12 '16 at 4:18











              0














              FINAL CODE - I did a layout update and it worked for me.



              config.xml



              <?xml version="1.0" encoding="UTF-8"?>
              <config>
              <modules>
              <MyCompany_MyModule>
              <version>0.1.0</version>
              </MyCompany_MyModule>
              </modules>
              <adminhtml>
              <layout>
              <updates>
              <myupdate>
              <file>myupdate.xml</file>
              </myupdate>
              </updates>
              </layout>
              </adminhtml>
              </config>


              myupdate.xml



              <layout version="0.1.0">
              <adminhtml_sales_order_view>
              <reference name="sales_order_edit">
              <action method="addButton">
              <id>my_button_identifier</id>
              <data>
              <label>My button</label>
              <class>go</class>
              </data>
              </action>
              </reference>
              </adminhtml_sales_order_view>
              </layout>





              share|improve this answer




























                0














                FINAL CODE - I did a layout update and it worked for me.



                config.xml



                <?xml version="1.0" encoding="UTF-8"?>
                <config>
                <modules>
                <MyCompany_MyModule>
                <version>0.1.0</version>
                </MyCompany_MyModule>
                </modules>
                <adminhtml>
                <layout>
                <updates>
                <myupdate>
                <file>myupdate.xml</file>
                </myupdate>
                </updates>
                </layout>
                </adminhtml>
                </config>


                myupdate.xml



                <layout version="0.1.0">
                <adminhtml_sales_order_view>
                <reference name="sales_order_edit">
                <action method="addButton">
                <id>my_button_identifier</id>
                <data>
                <label>My button</label>
                <class>go</class>
                </data>
                </action>
                </reference>
                </adminhtml_sales_order_view>
                </layout>





                share|improve this answer


























                  0












                  0








                  0







                  FINAL CODE - I did a layout update and it worked for me.



                  config.xml



                  <?xml version="1.0" encoding="UTF-8"?>
                  <config>
                  <modules>
                  <MyCompany_MyModule>
                  <version>0.1.0</version>
                  </MyCompany_MyModule>
                  </modules>
                  <adminhtml>
                  <layout>
                  <updates>
                  <myupdate>
                  <file>myupdate.xml</file>
                  </myupdate>
                  </updates>
                  </layout>
                  </adminhtml>
                  </config>


                  myupdate.xml



                  <layout version="0.1.0">
                  <adminhtml_sales_order_view>
                  <reference name="sales_order_edit">
                  <action method="addButton">
                  <id>my_button_identifier</id>
                  <data>
                  <label>My button</label>
                  <class>go</class>
                  </data>
                  </action>
                  </reference>
                  </adminhtml_sales_order_view>
                  </layout>





                  share|improve this answer













                  FINAL CODE - I did a layout update and it worked for me.



                  config.xml



                  <?xml version="1.0" encoding="UTF-8"?>
                  <config>
                  <modules>
                  <MyCompany_MyModule>
                  <version>0.1.0</version>
                  </MyCompany_MyModule>
                  </modules>
                  <adminhtml>
                  <layout>
                  <updates>
                  <myupdate>
                  <file>myupdate.xml</file>
                  </myupdate>
                  </updates>
                  </layout>
                  </adminhtml>
                  </config>


                  myupdate.xml



                  <layout version="0.1.0">
                  <adminhtml_sales_order_view>
                  <reference name="sales_order_edit">
                  <action method="addButton">
                  <id>my_button_identifier</id>
                  <data>
                  <label>My button</label>
                  <class>go</class>
                  </data>
                  </action>
                  </reference>
                  </adminhtml_sales_order_view>
                  </layout>






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 12 '16 at 4:45









                  ThisBetterWorkThisBetterWork

                  1084




                  1084























                      0














                      Have you defined your <blocks> and <models> within config.xml? If you didnt define models, that will explain why your observer didn't work. Well, that, and the fact that you have a layout handle as your event.



                      Additionally, instead of



                      if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')


                      you should go with



                      if($container instanceof Mage_Adminhtml_Block_Sales_Order_View)


                      That's because if you have some module or customization in the future, the "type" may change but it will most likely still extend from the original class.



                      Additionally, a super helpful tool created by Alan Storm, Commerce Bug. I use it every single day. In fact, it will provide you with a list of available observer events available on a given page.



                      Also, xdebug is very helpful when debugging Magento. You will know right away if your observer is firing. I made a short video on how to install xdebug. Xdebug Installation






                      share|improve this answer






























                        0














                        Have you defined your <blocks> and <models> within config.xml? If you didnt define models, that will explain why your observer didn't work. Well, that, and the fact that you have a layout handle as your event.



                        Additionally, instead of



                        if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')


                        you should go with



                        if($container instanceof Mage_Adminhtml_Block_Sales_Order_View)


                        That's because if you have some module or customization in the future, the "type" may change but it will most likely still extend from the original class.



                        Additionally, a super helpful tool created by Alan Storm, Commerce Bug. I use it every single day. In fact, it will provide you with a list of available observer events available on a given page.



                        Also, xdebug is very helpful when debugging Magento. You will know right away if your observer is firing. I made a short video on how to install xdebug. Xdebug Installation






                        share|improve this answer




























                          0












                          0








                          0







                          Have you defined your <blocks> and <models> within config.xml? If you didnt define models, that will explain why your observer didn't work. Well, that, and the fact that you have a layout handle as your event.



                          Additionally, instead of



                          if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')


                          you should go with



                          if($container instanceof Mage_Adminhtml_Block_Sales_Order_View)


                          That's because if you have some module or customization in the future, the "type" may change but it will most likely still extend from the original class.



                          Additionally, a super helpful tool created by Alan Storm, Commerce Bug. I use it every single day. In fact, it will provide you with a list of available observer events available on a given page.



                          Also, xdebug is very helpful when debugging Magento. You will know right away if your observer is firing. I made a short video on how to install xdebug. Xdebug Installation






                          share|improve this answer















                          Have you defined your <blocks> and <models> within config.xml? If you didnt define models, that will explain why your observer didn't work. Well, that, and the fact that you have a layout handle as your event.



                          Additionally, instead of



                          if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')


                          you should go with



                          if($container instanceof Mage_Adminhtml_Block_Sales_Order_View)


                          That's because if you have some module or customization in the future, the "type" may change but it will most likely still extend from the original class.



                          Additionally, a super helpful tool created by Alan Storm, Commerce Bug. I use it every single day. In fact, it will provide you with a list of available observer events available on a given page.



                          Also, xdebug is very helpful when debugging Magento. You will know right away if your observer is firing. I made a short video on how to install xdebug. Xdebug Installation







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 13 mins ago









                          Teja Bhagavan Kollepara

                          2,96341847




                          2,96341847










                          answered Aug 12 '16 at 5:41









                          Shawn AbramsonShawn Abramson

                          2,4771915




                          2,4771915






























                              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.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f131158%2fsimple-observer-not-working%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

                              “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                              How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                              變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...