title: How to show quantity in dropdown in product page and cart page magento
body: <p>I am using Magento ver. 1.9.2.1</p>
  
  <p>I just want to show quantity in dropdown for simple and configurable products in product view page and cart page as well.</p>
  
  <p>I replace code in <code>app/design/frontend/rwd/default/template/catalog/product/view/addtocart.phtml</code> page</p>
  
  <p>Replace below code</p>
  
  <pre><code>&lt;input class="qty-decrease" value="-" type="button" onclick="var qty_el = document.getElementById('qty'); var qty = qty_el.value; if( !isNaN( qty ) &amp;&amp; qty &gt; 1 ) qty_el.value--;return false;"&gt;
              &lt;input id="qty" class="input-text qty" type="text" maxlength="12" title="&lt;?php echo $this-&gt;__('Qty') ?&gt;" size="4" value="1" name="qty" style="padding-top: 0;"&gt;
  &lt;input class="qty-increase"  value="+" type="button" onclick="var qty_el = document.getElementById('qty'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;"&gt;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>&lt;select class="input-text qty" name="qty" id="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;
  </code></pre>
  
  <p>It is working fine for simple product but in configurable product, options are not showing. And in cart page I am unable to see anything for both types of products.</p>