1

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?

4
  • As far as I'm aware, WooCommerce doesn't support selecting a product quantity on archive pages. Are you using a theme or plugin to do this? Commented Nov 16, 2018 at 8:34
  • Using a theme. I updated the question! Commented Nov 16, 2018 at 10:35
  • 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 wordpress.org/plugins/… 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;} Commented Nov 20, 2018 at 14:05
  • wordpress.org/plugins/… I think this plugin help you... Commented Oct 19, 2022 at 9:28

1 Answer 1

0

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.

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.