Oh, I fixed it showing the woocommerce_quantity_input
with this code:
/**
* Override loop template and show quantities next to add to cart buttons.
*
* @param string $html HTML of the add to cart button.
* @param object $product Product object.
*
* @return string
*/
function cl_woo_quantity_inputs_loop( $html, $product ) {
if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() ) {
$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">';
$html .= woocommerce_quantity_input( array(), $product, false );
$html .= '<button type="submit" class="button alt">' . esc_html( $product->add_to_cart_text() ) . '</button>';
$html .= '</form>';
}
return $html;
}
add_filter( 'woocommerce_loop_add_to_cart_link', 'cl_woo_quantity_inputs_loop', 10, 2 );