title: Getting product quantity before and after saving a product in magento
body: <p>I have catch an event <code>catalog_product_save_commit_after</code> and written an observer for it to get product stock. </p>
  
  <p>In <code>config.xml</code> I have written the code below</p>
  
  <pre><code>&lt;events&gt;
       &lt;catalog_product_save_commit_after&gt;
         &lt;observers&gt;
           &lt;Arkix_Logs_observer&gt;
             &lt;type&gt;singleton&lt;/type&gt;
             &lt;class&gt;Arkix_Logs_Model_Observer&lt;/class&gt;
             &lt;method&gt;get_update_inventory&lt;/method&gt;
           &lt;/Arkix_Logs_observer&gt;
         &lt;/observers&gt;
       &lt;/catalog_product_save_commit_after&gt;     
     &lt;/events&gt;
  </code></pre>
  
  <p>In <code>Observer.php</code> I have written:</p>
  
  <pre><code> public function get_update_inventory( $observer){
  
      $product = $observer-&gt;getEvent()-&gt;getItem();
      $origStockData = $product-&gt;getOrigData('stock_item')-&gt;getOrigData();//to get original stock
      echo '&lt;pre&gt;';print_r($origStockData);
      $stockData = $product-&gt;getStockItem()-&gt;getData();//to get new stock
  
     echo "product name id   ".$product-&gt;getId();
  
    die('haha');
  }
  </code></pre>
  
  <p>But error is coming Call to a member function <code>getOrigData()</code> on non object in observer.php</p>