title: Magento: Custom Javascript Alert After Product Add to Cart
body: <p>I've been following various tutorials to try and use Magento event observers to display a custom Javascript alert after a customer adds a product to their cart, but can't seem to get anything. Am I even close to going down the right track?</p>
  
  <p>My Module:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;Shoplio_XS&gt;
              &lt;active&gt;true&lt;/active&gt;
              &lt;codePool&gt;local&lt;/codePool&gt;
          &lt;/Shoplio_XS&gt;
      &lt;/modules&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>My config.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;Shoplio_XS&gt;
              &lt;version&gt;0.1.0&lt;/version&gt;
          &lt;/Shoplio_XS&gt;
      &lt;/modules&gt;
      &lt;frontend&gt;
          &lt;events&gt;
              &lt;sales_quote_product_add_after&gt;
                  &lt;observers&gt;
                      &lt;Shoplio_XS_Model_Observer&gt;
                          &lt;type&gt;singleton&lt;/type&gt;
                          &lt;class&gt;Shoplio_XS_Model_Observer&lt;/class&gt;
                          &lt;method&gt;Mytestmethod&lt;/method&gt;
                      &lt;/Shoplio_XS_Model_Observer&gt;
                  &lt;/observers&gt;
              &lt;/sales_quote_product_add_after&gt;
          &lt;/events&gt;
      &lt;/frontend&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>My observer.php:</p>
  
  <pre><code>&lt;?php class Shoplio_XS_Model_Observer
  {
      public function Mytestmethod($observer) {
          $event = $observer-&gt;getEvent();
  
          // Javascript Alert Here
  
      } 
  }
  </code></pre>
  
  <p>I'm primarily following this tutorial: <a href="http://goo.gl/DRwd5" rel="nofollow">http://goo.gl/DRwd5</a></p>
  
  <p>The only difference is, I don't want to display anything on the shopping cart page because I keep customers on the product page after a product is added to cart. I simply want to display a custom Javascript alert on the product page after the product is added to cart.</p>