title: How to add quantity option to each product item in the category list page?
body: <p>How can I add quantity option to each product item in the category list page?</p>
  
  <p>By default, you can find this in Magento <strong>list.phtml</strong>,</p>
  
  <pre><code>&lt;?php if($_product-&gt;isSaleable()): ?&gt;
      &lt;p&gt;&lt;button type="button" title="&lt;?php echo $this-&gt;__('Add to Cart') ?&gt;" class="button btn-cart" 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;/p&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;
  </code></pre>
  
  <p>So every time you click the <strong>Add to Cart</strong> button, it is only 1 quantity to be added to the shopping cart.</p>
  
  <p>I want to add this option so the customer can add the quantity they want at this stage,</p>
  
  <pre><code>&lt;?php if(!$_product-&gt;isGrouped()): ?&gt;
      &lt;input type="text" name="qty" id="qty" placeholder="1" maxlength="12" value="&lt;?php echo $_product-&gt;getProductDefaultQty() * 1 ?&gt;" title="&lt;?php echo $this-&gt;__('Qty') ?&gt;" class="input-text qty input-quantity" /&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>The first problem is that <code>&lt;?php echo $_product-&gt;getProductDefaultQty() * 1 ?&gt;</code> always shows the value of <code>0</code>.</p>
  
  <p>The second problem is that if I put the quantity value manually to be, say 20, I will still get 1 only for that product item that I have clicked to add to the shopping cart.</p>
  
  <p>Any ideas?</p>