Replace quantity input with dropdown of fixed quantities
-
I’ve used woocommerce_quantity_input() to insert a quantity input and add to cart button on a page for a particular set of products. For those that are setup with fixed-quantity pricing when you click on the add to cart button it redirects to the product page. Is there a way to insert the dropdown for fixed quantities for a product?
I’d need to know what property to access to check whether a product has the fixed quantity pricing active and then if there’s a function or chunk of code that would display the dropdown with fixed pricing for that specified product.
Here’s my code that’s working for the quantity input:
<form action="<?php echo esc_url( $product->add_to_cart_url() );?>" class="cart <?php echo $lowinv_alert;?>" method="post" enctype="multipart/form-data"> <td> if ($reorder > 0 ){ echo woocommerce_quantity_input( array('input_value' => $reorder ), $product, false ); }else{ echo woocommerce_quantity_input( array(), $product, false ); } ?> </td> <td> <button type="submit" class="button alt">Add To Cart</button> </td> </form>
Any help is much appreciated!
- The topic ‘Replace quantity input with dropdown of fixed quantities’ is closed to new replies.