0

How can I show product quantity drop down to customer for offering quantity as follows on product view page; 1 / 10 / 20 / 30 / 40 / 50 / 60 / 70 / 80 / 90 / 100

Any suggestion would be appreciated.

1
  • @Arunendra, qty is showing already in dropdown there like 1,2,3,4,5,6,7,8,9,10 and so on but now I want to show quantity as 1,10,20,30 and so on.
    – Shashank
    Jan 19, 2017 at 10:44

1 Answer 1

0

As per your comment you can modify your drop down with this code:

<?php
if($this->getStockMaximumQty()>0)
{
    $maximum = $this->getStockMaximumQty()/10;
    $html = '<option value="1">1</option>';

    for($i=1;$i<=intval($maximum);$i++){
        $val = $i*10;
        $html .= '<option value="'.$val.'">'.$val.'</option>';
    }
    ?>
    <select name="quantity" id="qty">
          <?php echo $html; ?> 
    </select>

<?php } else { ?>

 <?php echo $this->__('This product is currently out of stock.'); ?>
<?php } ?>

Not the answer you're looking for? Browse other questions tagged or ask your own question.