Skip Navigation

[Resolved] AJAX and add to cart with show_quantity_in_button (Woocommerce)

This support ticket is created 7 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 12 replies, has 2 voices.

Last updated by xavierC-2 7 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#426203

Hi,

I read on the forum when show_quantity_in_button is YES, then the AJAX doesn't work and the page reloads when client clicks on add to cart.

But I read it will be implemented.

I guess it's still not implemented, do you know when ?

#426270

Or would it be possible to hide the "add to cart" button for every product, but still show the quantity field and have only one "add to cart" button ?

-> The client add quantities for each product and only click one time on the add to cart button and all the products are added to the cart with the right quantity !?

#426890

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Xavier,

Thank you for contacting our support forum.

I must apologize for the extreme delay in response.

What you are referring to is a bulk adding of product to a cart correct ? If so then this would require a custom solution as each add to cart button is tied to the specific product.

You might be able to do this with some custom coding but this is out of our forum scope.

Thanks,
Shane

#426908

Hi Shane,

thank you for your reply. It is not exactly a bulk adding of product.

The page will display several product (WordPress archive), thanks to Toolset. For each product there's one add-to-cart button and one quantity field.

Current behaviour : as soon as we click on the button, it adds the correct amount of product, but it reloads the page.

Expected behaviour : same thing, but without reloading the page. I read on another post it will be a functionality...

This will give the opportunity for the client to add several products (with good quantity) without reloading the page.

#427113

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Xavier,

I understand this alot better now 🙂

Taking a look at the documentation for the shortcode I see where it can work with AJAX
https://toolset.com/documentation/views-shortcodes/#wpv-woo-buy-or-select

The above instructions should guide you on how to do it.

Thanks,
Shane

#427172

Unfortunately when we add the quantity field, it doesn't work. It only work on the archive page without quantity field.

I bought a plugin to "ajaxify" the buttons, but it only works on the Single Page Product.

Any idea how to "ajaxify" the button on an archive with the quantity field ? You can refer to the test site I sent on another topic.

Thank you Shane for your help.

#427777

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Xavier,

It seems it doesnt work when the quantity field is added.

Would you mind letting me know the thread you were mentioning in your first post?

I would like to see if there is an escalated ticket attached to it.

Thanks,
Shane

#427811

Hi Shane,

here it is : https://toolset.com/forums/topic/problem-with-woocommerce-views-add-to-cart-always-reloads-page/

Last reply of «In the future, this feature will be supported by inside WooCommerce Views.»
I'm not sure he's speaking about enabling AJAX when show_quantity_in_button is set "yes".

#428203

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Xavier,

Would you mind if I took a look at the issue on the website itself?

I just want to see how things are setup so that I can create an escalated ticket for this issue.

The private fields will be enabled for your next response.

Thanks,
Shane

#428388

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Xavier,

I've messaged our developer regarding this once he replies I will let you know.

Thanks,
Shane

#428701

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Xavier,

I have good news.

This functionality was actually available in our Woocommerce views plugin since version 2.5.5 but it broke when Woocommerce core updated to version 2.5.2

However we have released an update to woocommerce views that should fix this problem.

Please try updating and let me know.

Thanks,
Shane

#428925

Hi,

I tried on another test site, everything is up to date and it doesn't seem to work (Woocommerce View 2.6.5).

Need I to specify something in the shortcode ?

#428928

Nevermind, 2.6.6 was released....

I updated it and it works ! 🙂

Thank you Shane !

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.