title: Ubercart and Drupal 7 - hook_add_to_cart
body: <p><a href="http://www.ubercart.org/docs/api/hook_add_to_cart" rel="nofollow">http://www.ubercart.org/docs/api/hook_add_to_cart</a></p>
  
  <p>I am trying to hook into the add cart functionality of ubercart. I have created stock_control.module and stock_control.info files and enabled the module. In my .module file I have</p>
  
  <p>The first is output but the 2nd is not.</p>
  
  <pre><code>&lt;?php
     dsm('hello1');
       function stock_control_add_to_cart($nid, $qty, $data) {
      dsm('hello2');
       if ($qty &gt; 1) {
      $result[] = array(
    '        success' =&gt; FALSE,
    'message' =&gt; t('Sorry, you can only add one of those at a time.'),
  );
    }
    return $result;
   } 
  </code></pre>