title: Ajax in magento (load product view block)
body: <p>What I want to achieve:
  Clicking on a product link/image (at least in certain areas) to open a pop-up with the full product information (basically all the contents of the product view page).</p>
  
  <p>What I did/tried so far:</p>
  
  <ul>
  <li>created all the stuff outside the ajax php code (the module, links, templates, rewrites)</li>
  <li>created the ajax controller (which can be accessed with a link similar to: <code>http://test.com/index.php/ajaxproductview/ajax/index/id/2</code> ).</li>
  <li>to follow various tutorials ( like <a href="http://blog.magikcommerce.com/how-to-use-ajax-in-your-magento-modules-themes/" rel="nofollow">this</a> or <a href="http://blog.decryptweb.com/ajax-in-magento/" rel="nofollow">this</a> ) - that helped me get this far. But I don't want to load my custom block, I want the default product view block(s).</li>
  <li><p>tried to add some code in the indexAction(). It gets there, but the code fails. I don't get any errors/notices/reports, just what it seems like an infinite loop that kills my processor.</p>
  
  <pre><code>$body = $this
      -&gt;getLayout()
      -&gt;createBlock('product.info') // taken from catalog.xml
      -&gt;toHtml();
  $this-&gt;getResponse()-&gt;setBody($body);
  </code></pre></li>
  </ul>
  
  <p>All the other pages work fine, and it's a fresh magento with only magneto and my module installed and activated.</p>
  
  <p>My AJAX function simply gets this HTML response, puts it into a div, and opens a pop-up.</p>
  
  <p>My question(s) is(are) - how can I set the product id, so the block knows what product to load, and how can I load this block correctly. I also tried something similar to this:</p>
  
  <p>Thank you.</p>
  
  <p>PS: I also tried this:</p>
  
  <pre><code>    $layout = $this-&gt;getLayout();
      $update = $layout-&gt;getUpdate();
      $update-&gt;load('catalog_product_view');
      $layout-&gt;generateXml();
      $layout-&gt;generateBlocks();
      $output = $layout-&gt;getOutput(); // $output is an empty string
  </code></pre>