Magento WizardWelcome to the Number 1 Magento Hosting website.

Contact the site  Make Money

Change Default Quantity on Magento Product Page

 Add to Favourites  
(+2 rating, 4 votes)
Loading ... Loading ...

I find it a tad annoying how on Magento, you’ve got this empty quantity box next to the Buy Now/Add to Basket button.  Although clicking the button alone will add an item to the cart, some users may experience doubt in this motion, and enter the quantity required AS WELL as press the button.

But why even have any doubt?  Why not just make the default quantity set to 1 – well this something that a lot of people have required, and fortunately, I have got the answer!

In app\design\frontend\default\default\template\catalog\product\view\type\Simple.phtml

Just change…

<input id="qty" class="input-text qty" maxlength="12" name="qty" type="text" value="&lt;?php echo $this-&gt;getMinimalQty($_product) ?&gt;" />

To…

<input id="qty" class="input-text qty" maxlength="12" name="qty" type="text" value="&lt;?php echo $this-&gt;getMinimalQty($_product)== null?1:$this-&gt;getMinimalQty($_product) ?&gt;" />
Be Sociable, Share!

about the author

    This article was written by Sam Davis on November 20, 2008.
    Computing over a glass of Grenache Shiraz... again!
    Sam is the Editor of Blasted Thing. Contact Us

related articles

 Product Comparison - Video Guide
 Product Page Ratings & Reviews - Video Guide
 Search on Magento - Video Guide
 Product Tags on Product Page - Video Guide
 Image upload failure on Magento Product Page

comments


Remove Product Tags from Magento Product Page

  • Sponsored Ads

  • Magento Themes
    • baljit: pls helps me gateway error :transction is not accepeted...
  • Recent Tweets