In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?

As it stands right now, in WooCommerce 3.5.1, at product archive (the /shop page), if you use the +/- buttons to set a quantity before clicking "Add to cart", all is fine. But if you try to actually type it in the input#quantity field instead of using the buttons, it adds just one product to cart.

This plugin seems to not have the issue, for single products: https://wordpress.org/plugins/woocommerce-ajax-cart/

This guy has done something similar for the cart page: https://businessbloomer.com/woocommerce-automatically-update-cart-quantity-change/

Using the theme Porto: https://themeforest.net/item/porto-responsive-wordpress-ecommerce-theme/9207399

Please test using this website: https://upvotes.club/product-category/managed-services/

Any idea how to solve it for the product archive as well?

Topic woocommerce-offtopic jquery-ui ajax jquery Wordpress

Category Web


If using this plugin instead of the theme functionality, and in the same time except jquery from minification and grouping, it works:

Quantity Field on Shop Page for WooCommerce https://wordpress.org/plugins/quantity-field-on-shop-page-for-woocommerce/

It seems that jQuery has to be excepted from minification and grouping because otherwise the code starting with this gives an error:

<script type="text/javascript">jQuery('.products .post-10 a').click(function(){if(true===jQuery(this).hasClass('add_to_cart_button')){return;}

Anyway, they said they'll be fixing the theme in the version, so buying Reddit upvotes and other marketing services will be possible through https://upvotes.club without any additional WordPress plugin on the backend.

Hopefully the solution that I gave ends up saving someone else in a similar situation.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.