title: Magento: Sorting a product collection
body: <p>I'm creating a template to display featured products on the home page, and I'd like to control the order of the products.</p>
  
  <p>This is what I'm using at the moment to fetch a product collection based on a category:</p>
  
  <pre><code>&lt;?php
      $_productCollection = $this-&gt;getLoadedProductCollection();
  ?&gt;
  </code></pre>
  
  <p>No specific sorting at all.</p>
  
  <p>When I were going to sort the products, I expected this to work:</p>
  
  <pre><code>&lt;?php
      $_productCollection = $this-&gt;getLoadedProductCollection()-&gt;addAttributeToSort('name', 'ASC');
  ?&gt;
  </code></pre>
  
  <p>But there's no difference at all. What am I doing wrong?</p>
  
  <p>Thank you in advance!</p>