1. Home
  2. Knowledge Base
  3. WooCommerce Product Table Ultimate
  4. Troubleshooting Product Table Ultimate
  5. Reset quantities to 1
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Table Ultimate
  4. Reset quantities to 1

Reset quantities to 1

If you find that product quantities change after a user adds an item to their cart, you can use the following snippet to reset all quantities to a certain default value, e.g. 1:

<?php
function prefix_reset_table_quantity( $args, $product ) {
$args['input_value'] = 1;
return $args;
}
add_filter( 'woocommerce_quantity_input_args', 'prefix_reset_table_quantity', 10, 2 );

Here’s how to add a snippet.

Was this article helpful?