title: Magento 1.7 customer_save_before observer
body: <p>Following a tutorial I'm trying to make an observer that changes the customer's group on registration/edit based on a custom field value. I can't seem to get the event observer to work, I guess it's a syntax thing since the tutorial is for 1.4 and I'm on 1.7. Any help would be apreciated:</p>
  
  <p><strong>/app/etc/modules/Nonsintetic_All.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;config&gt;
    &lt;modules&gt;
        &lt;Nonsintetic_Membership&gt;
            &lt;active&gt;true&lt;/active&gt;
            &lt;codePool&gt;local&lt;/codePool&gt;
        &lt;/Nonsintetic_Membership&gt;
    &lt;/modules&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p><strong>/app/code/local/Nonsintetic/Membership/etc/config.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;Nonsintetic_Membership&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/Nonsintetic_Membership&gt;
      &lt;/modules&gt;
      &lt;global&gt;
          &lt;events&gt;
              &lt;customer_save_before&gt;
                  &lt;observers&gt;
                      &lt;nonsintetic_membership_save_observer&gt;
                          &lt;type&gt;singleton&lt;/type&gt;
                          &lt;class&gt;Nonsintetic_Membership_Model_Observer&lt;/class&gt;
                          &lt;method&gt;customer_save_before&lt;/method&gt;
                      &lt;/nonsintetic_membership_save_observer&gt;
                  &lt;/observers&gt;
              &lt;/customer_save_before&gt;
          &lt;/events&gt;
      &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p><strong>/app/code/local/Nonsintetic/Membership/Model/Observer.php</strong></p>
  
  <pre><code>&lt;?php
  
  class Nonsintetic_Membership_Model_Observer extends Mage_Core_Model_Abstract
  {
      /*
       * observer for the customer saved event
       */
      public function customer_save_before( $observer )
      {
          try {
              $customer = $observer-&gt;getCustomer();
                      Mage::log( "customer_save_before TRIGGERED" );
              if( $customer-&gt;getCardmembru() == "TEST123" ) {
                  $customer-&gt;setData( 'group_id', 4 ); // Set the new customer group
              } else {
                  $customer-&gt;setData( 'group_id', 1); // Set to the default customer group
              }
          } catch ( Exception $e ) {
              Mage::log( "customer_save_before observer failed: " . $e-&gt;getMessage() );
          }
      }
  }
  
  ?&gt;
  </code></pre>