title: Dropdown for Quantity chooser in Magento only submitting one product
body: <p>I have integrated a new CMS product page for my Magento store and would like to use a dropdown quantity chooser for users to select how many items they would like to purchase.</p>
  
  <p>So far i have the quantity chooser showing on the page but for some reason it is not functioning as intended.</p>
  
  <p>1) I have set the amount of products that can be purchased to a maxinmum of 5 but the quantity chooser is showing the amount that is in the inventory (currenty set to 1000!)</p>
  
  <p>2) when I select an amount that is greater than 1 only 1 product is added to the shopping basket</p>
  
  <p>I have been trying to adapt and amend the code but I am unable to get it working properly. If anyone has an idea of how I should be doing this I would be grateful for a heads up!</p>
  
  <p>Here's the code:</p>
  
  <pre><code>&lt;?php 
  $category_id = "49"; // category_id for "Products"
  $_productCollection = Mage::getResourceModel('catalog/product_collection')
  -&gt;addAttributeToSelect(array('name', 'price', 'small_image', 'short_description'), 'inner')
  -&gt;addCategoryFilter(Mage::getModel('catalog/category')-&gt;load($category_id));
  ?&gt;
  &lt;?php if($_productCollection-&gt;count()): ?&gt;
  
         &lt;?php 
         $products = array();
         foreach ($_productCollection as $_product) { 
          ?&gt;
  
      &lt;div class="media"&gt;
            &lt;a class="fancybox static-thumbs pull-left" href="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($_product, 'small_image')-&gt;resize(500, 450); ?&gt;" alt="&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, 'small_image')) ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, 'small_image')) ?&gt;"&gt;
              &lt;img class="media-object" src="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($_product, 'small_image')-&gt;resize(150, 125); ?&gt;" alt="&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, 'small_image')) ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, 'small_image')) ?&gt;" /&gt;
            &lt;/a&gt;
      &lt;div class="media-body span5"&gt;
         &lt;h4 class="media-heading"&gt;&lt;a class="view-item-button" href="&lt;?php echo $_product-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;"&gt;&lt;?php echo $this-&gt;__('Order'); ?&gt; &lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName())?&gt;&lt;?php echo $this-&gt;__('&amp;#8482;'); ?&gt;&lt;/a&gt;&lt;/h4&gt;
  
          &lt;p&gt;
              &lt;?php echo $_product-&gt;_data['short_description']; ?&gt;
          &lt;/p&gt;
        &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="media span2"&gt; 
          &lt;h2 class="product-name"&gt;Price &lt;?php echo Mage::helper('core')-&gt;currency($_product-&gt;getPrice());; ?&gt;&lt;/h2&gt;
           &lt;?php if($_product-&gt;isSaleable()): ?&gt;
           &lt;select name="qty"&gt;
              &lt;?php $i = 1 ?&gt;
                  &lt;?php do { ?&gt;
                  &lt;option value="&lt;?php echo $i?&gt;"&gt;
              &lt;?php echo $i?&gt;
              &lt;?php $i++ ?&gt;
                  &lt;/option&gt;
              &lt;?php } while ($i &lt;= (int)Mage::getModel('cataloginventory/stock_item')-&gt;loadByProduct($_product)-&gt;getQty()) ?&gt;
          &lt;/select&gt;
          &lt;div class="clearfix"&gt;&lt;/div&gt;
              &lt;button type="button" title="&lt;?php echo $this-&gt;__('Add to Cart') ?&gt;" class="btn btn-danger" onclick="setLocation('&lt;?php echo $this-&gt;getAddToCartUrl($_product) ?&gt;')"&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Add to Cart') ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt;
                  &lt;?php else: ?&gt;
              &lt;p class="availability out-of-stock"&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Out of stock') ?&gt;&lt;/span&gt;&lt;/p&gt;
          &lt;?php endif; ?&gt; 
          &lt;?php } ?&gt;
      &lt;/div&gt;
  
  &lt;?php endif; ?&gt;
  &lt;script type="text/javascript"&gt;
      $j(document).ready(function() {
          $j(".fancybox").fancybox();
      });
  &lt;/script&gt;
  </code></pre>