{"id":218,"date":"2011-06-03T04:29:18","date_gmt":"2011-06-03T09:29:18","guid":{"rendered":"http:\/\/www.g31zone.com\/?p=218"},"modified":"2011-06-03T06:08:08","modified_gmt":"2011-06-03T11:08:08","slug":"magento-show-quantity-box-in-products-list","status":"publish","type":"post","link":"https:\/\/www.g31zone.com\/?p=218","title":{"rendered":"Magento &#8211; Show Quantity Box in Products List"},"content":{"rendered":"<p>In file &#8216;list.phtml&#8217; file change the &lt;button&gt; line near line 108 from this:<\/p>\n<p><code><br \/>\n&lt;?php if($_product->isSaleable()): ?&gt;<br \/>\n&lt;button class=\"form-button\" onclick=\"setLocation('&lt;?php echo $this->getAddToCartUrl($_product) ?&lt;')\"&gt;&gt;span&gt;<br \/>\n&lt;?php echo $this->__('Add to Cart') ?&gt;&lt;\/span&gt;&lt;\/button&gt;<br \/>\n<\/code><\/p>\n<p>with:<\/p>\n<p><code><br \/>\n&lt;form action=\"<br \/>\n&lt;?php echo $this->getAddToCartUrl($_product) ?&gt;\" method=\"post\" id=\"product_addtocart_form_&lt;?php echo $_product->getId(); ?&gt;\"&gt;<br \/>\n&lt;input name=\"qty\" type=\"text\" class=\"input-text qty\" id=\"qty\" maxlength=\"12\" value=\"<br \/>\n&lt;?php echo $this->getMinimalQty($_product) ?&gt;\" \/&gt;<br \/>\n&lt;button class=form-button\" onclick=\"productAddToCartForm_<br \/>\n&lt;?php echo $_product->getId(); ?&gt;.submit()\"&gt;&lt;span&gt;<br \/>\n&lt;?php echo $this->__('Add to Cart') ?&gt;&lt;\/span&gt;&lt;\/button&gt;<br \/>\n&lt;\/form&gt;<br \/>\n&lt;script type=\"text\/javascript\"&gt;<br \/>\n     var productAddToCartForm_<br \/>\n&lt;?php echo $_product->getId(); ?&gt; = new VarienForm('product_addtocart_form_<br \/>\n&lt;?php echo $_product->getId(); ?&gt;');<br \/>\n     productAddToCartForm_<br \/>\n&lt;?php echo $_product->getId(); ?&gt;.submit = function(){<br \/>\n     if (this.validator.validate()) {<br \/>\n             this.form.submit();<br \/>\n         }<br \/>\n     }.bind(productAddToCartForm_&lt;?php echo $_product->getId(); ?&gt;);<br \/>\n&lt;\/script&gt;<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/www.westwideweb.com\/wp\/2009\/01\/28\/magento-show-quantity-box-in-category-view\/\" rel=\"nofollow\">Read full article<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In file &#8216;list.phtml&#8217; file change the &lt;button&gt; line near line 108 from this: &lt;?php if($_product->isSaleable()): ?&gt; &lt;button class=&#8221;form-button&#8221; onclick=&#8221;setLocation(&#8216;&lt;?php echo $this->getAddToCartUrl($_product) ?&lt;&#8216;)&#8221;&gt;&gt;span&gt; &lt;?php echo $this->__(&#8216;Add&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[170],"tags":[5,76,77],"class_list":["post-218","post","type-post","status-publish","format-standard","hentry","category-magento","tag-magento","tag-products-list","tag-quantity-box"],"_links":{"self":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=218"}],"version-history":[{"count":10,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/218\/revisions"}],"predecessor-version":[{"id":229,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=\/wp\/v2\/posts\/218\/revisions\/229"}],"wp:attachment":[{"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.g31zone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}