Qty dropdown in cart (Qtys come from tier prices)

If product has tier prices we can create dropdown in cart .. otherwise there will be standart QTY box

first update default.phtml … in chcekout/cart/item/default.phtml .. with code below

<?php
    $ID = $_item->getProductId();
   
     $_product =  Mage::getModel('catalog/product')->load($ID);

     $prices = $_product->getTierPrice();
     if($prices!=NULL){ 
              echo '<select id="selectqty" onchange="getNewVal(this);" style="margin-top:13px;border:1px solid;height:30px;">';
              echo ' <option value="'.$this->getQty().'">'.$this->getQty().'</option>';
            foreach($prices as $tier){
                  // echo intval($tier[price_qty]).'<br/>';
                   echo '<option value="'.intval($tier[price_qty]).'_'.$_item->getId().'">'.intval($tier[price_qty]).'</option>';
             } 
      echo '</select>';
      ?>
       <input style="visibility:hidden;" type="text" id="<?php echo $_item->getId() ?>_QTY" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" 
         size="4" title="<?php echo $this->__('Qty') ?>" class="input-text input-block-level qty" maxlength="12" />
          <?php
             }else{
            ?>
        <input type="text" id="<?php echo $_item->getId() ?>_QTY" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" 
         size="4" title="<?php echo $this->__('Qty') ?>" class="input-text input-block-level qty" maxlength="12" /> 
             <?php 
                }
            ?>

and at the bottom add this

next.. update cart.phtml in checkout/cart.phtml

find button “Update Shopping Cart” and add id=”update_cart”

 <button type="submit" id="update_cart" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" 
    class="btn btn-link update"><i class="fa fa-rotate-right"></i> <?php echo $this->__('Update Shopping Cart'); ?></button>