-1

With Enable decimal quantities and stock for WooCommerce products answer code, I changed the step of product quantity fields in my Woocommerce shop.

The problem which now occurs, is that if the quantity is a float value, in the administrative view of the order, the order cannot be updated with the following console error:

An invalid form control with name='order_item_qty[]' is not focusable.

Can someone tell me what filter I need to add in order to change the minimum quantity? Or how I can bypass the validation there?

1 Answer 1

0

I have found a solution, the issue was the step from the order in administration view was 1 instead of 0.1.

The solution:

add_filter( 'woocommerce_quantity_input_step', 'filter_woocommerce_quantity_input_step', 10, 2 );
function filter_woocommerce_quantity_input_step($arg, $product) { 
    $arg = 0.1;
    return $arg; 
}; 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.