Adding a quantity button to the grid layout
-
Hi there,
How can I add a quantity button only in the grid layout?
Hello,
Try to add the following code snippet from article to the functions.php file in the child theme.
https://docs.woocommerce.com/document/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/
Kind Regards
XTemos Studio
Thanks for the code it worked.
The only downside that it goes to zero. Is there a way to limit this?
Attachments:
You must be
logged in to view attached files.
That causes the whole theme to crash if you try to purchase with zero as the quantity.
Hello,
Try to add the following code snippet to the functions.php file in the child theme.
add_filter( 'woocommerce_quantity_input_args', 'basel_woocommerce_quantity_input_args', 10, 2 );
function basel_woocommerce_quantity_input_args( $args, $product ) {
$args['min_value'] = 1; // Minimum value
return $args;
}
Kind Regards
XTemos Studio