Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Need help about QTY input. 
 
BruceLee00
Jr. Member
 
Total Posts:  6
Joined:  2012-08-09
 

Hi everybody,

How I can change the input text of QTY in product page to selector. Please help me.
Thank you in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
magestore
Mentor
 
Avatar
Total Posts:  1015
Joined:  2009-08-07
Viet Nam
 

Hello BruceLee00,
It is very easy. You just need to change in the file:

app\design\frontend\your_package\your_template\template\catalog\product\view\addtocart.phtml

and change:

<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />

to:

<select name="qty">
     <
option value="1">1</option>
     <
option value="2">2</option>
     <
option value="3">3</option>
     <
option value="4">4</option>
     <
option value="5">5</option>
     <
option value="6">6</option>
  </
select>

Also, you can add some elements such as Jquery and css so that it is more attractive.

Hope you succeed,
Magestore

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top