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 to see the link]
- The topic ‘Drop down with max quantity’ is closed to new replies.