Thanks for answering. My problem is another.
Today I have a code
********************************
add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘dcms_add_quantity_field’, 10, 2 );
function dcms_add_quantity_field($html, $product) {
if ( is_user_logged_in() ) {
if($product&&
$product->is_type(‘simple’)&&
$product->is_purchasable()&&
$product->is_in_stock()&&
!$product->is_sold_individually()){
$html='<form class="cart" action="'. esc_url($product->add_to_cart_url()).'" method="post" enctype="multipart/form-data">';
$html.= woocommerce_quantity_input(array(),$product,false);
$html.='<button type="submit" data-quantity="1" data-product_id="'.$product->get_id().'" class="primary is-small mb-0 button wp-element-button product_type_simple add_to_cart_button ajax_add_to_cart is-outline" style="border-radius: 10px;">'. esc_html($product->add_to_cart_text()).'</button>';
$html.='</form>';
}
return $html;
}
}
//Agreamos código javascript
add_action( ‘init’, ‘dcms_quantity_change’ );
function dcms_quantity_change() {
wc_enqueue_js(‘
(function( $ ) {
$(“form.cart”).on(“change”, “input.qty”, function() {
$(this.form).find(“[data-quantity]”).attr(“data-quantity”, this.value);
});
})( jQuery );
‘);
}
*****************************************
that adds the possibility of adding by quantity to the products in the catalog. What this causes me is that the search engine shows 2 quantity fields, you can see it at torres3.open24.com.ar and only one works. By modifying the plugin I remove it, but when updating I lose it again.