WooCommerce – Reset quantity input field when variation changes

To reset quantity input field to 1 when variation changes on product detail page use below code. you can set default quantity from jQuery("[name="quantity"]").val(1);. i have tested and it is working fine for me.

add_action( 'wp_footer', 'variation_change_update_qty' ); 
function variation_change_update_qty() { 
   if (is_product()) { 
      ?> 
      <script>
        jQuery(function($){
            $( ".variations_form" ).on( "woocommerce_variation_select_change", function () {
                jQuery("[name="quantity"]").val(1);
            } )
            });
     </script> 
      <?php 
   } 
}

let me know is this works for you!