Title: Drop down with max quantity
Last modified: July 20, 2018

---

# Drop down with max quantity

 *  [geokongr](https://wordpress.org/support/users/geokongr/)
 * (@geokongr)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/drop-down-with-max-quantity/)
 * Hello,
 * Is it possible to get the max quantity variable and pass it to the following &
   max variable so i can have a drop down (select html tag) with the maximum number
   defined by your plugin?
 *     ```
       /**
        * @snippet       Add to Cart Quantity drop-down - WooCommerce
        * @how-to        Watch tutorial @ https://businessbloomer.com/?p=19055
        * @sourcecode    https://businessbloomer.com/?p=72757
        * @author        Rodolfo Melogli
        * @testedwith    WooCommerce 3.1.1
        */
   
       function woocommerce_quantity_input() {
   
         $min = 1;
         $max = 5;
         $step = 1;
         $options = '';
   
         for ( $count = $min; $count <= $max; $count = $count+$step ) {
           $options .= '<option value="' . $count . '">' . $count . '</option>';
         }
   
         echo '<div class="select-qty"><label>Qty</label><select name="quantity">' . $options . '</select></div>';
       }
       ```
   
 * Kind regards
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdrop-down-with-max-quantity%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Drop down with max quantity’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-max-quantity/assets/icon.svg?rev=3563132)
 * [Maximum Quantity for WooCommerce Shops](https://wordpress.org/plugins/woocommerce-max-quantity/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-max-quantity/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-max-quantity/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-max-quantity/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-max-quantity/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-max-quantity/reviews/)

## Tags

 * [drop-down](https://wordpress.org/support/topic-tag/drop-down/)
 * [max](https://wordpress.org/support/topic-tag/max/)
 * [select tag](https://wordpress.org/support/topic-tag/select-tag/)

 * 0 replies
 * 1 participant
 * Last reply from: [geokongr](https://wordpress.org/support/users/geokongr/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/drop-down-with-max-quantity/)
 * Status: not resolved