Site logo

Archived topic

Possible bug in Sticky Add to Cart Panel

5 replies · Started by José Manuel on October 6, 2021

Viewing posts 1–6 of 6

Hello there,

I think I have detected a possible failure, although I am not sure :(
I'll tell you what happens in case it has happened to other users.

When the AJAX add to cart option is active and you add a related product from a product page, the Sticky Add to Cart Panel div is displayed empty.

If in "customizer> layout> woocommerce" in the Single Product options active "Display add to cart panel on scroll" data is shown but it is not a summary of the purchase, it is data of the main product that is being visited. I think this would not be the expected behavior.

I have disabled that option in Single Product and modified a condition in the function generatepress_wc_add_to_cart_helper to display the cart summary, but I wish I could do it without modifying the GP Premium code. Is there any solution?

Sorry for sending such a long message and in such bad English.

Thank you very much for your help.

Hi there,

I'm not sure I'm fully understanding.

There are two options:

1. Display cart panel on add to cart - this option is only available on your shop/archive pages. It will show a panel once you add an item to your cart.
2. Display add to cart panel on scroll - this option is only available on your single products. It will show a panel for the main product you're viewing once you scroll past the add to cart button.

Neither of these should have anything to do with related posts, as they appear in different areas (archives vs single products) of your site.

Let me know if I'm misunderstanding something :)

Hello Tom,

I understand what you are saying but, Related Products are actually displayed on the single product. When having the buttons activated by AJAX in WooCommerce and adding a related product to the cart, what should be the default behavior?

As I mentioned, with the option "Display add to cart panel on scroll" activated, the panel with the data of the main product is shown and that causes confusion.

Maybe I'm doing something wrong ...

I am very thankfull for your help.

Any chance you can show me a quick video/series of screenshots of what you're seeing on your end?

For example, when I add the related product to my cart on the following page, nothing appears. The regular add to cart panel is visible because I've scrolled past the add to cart button on the page, but that's it: https://gpsites.co/merch/product/quality-poster/

Let me know :)

Hello Tom,

It is possible that this panel that is appearing in our store is due to the modifications that I have made. I already have it fixed.

But I really think that the way to Add to cart related products by AJAX can be confusing for the customer. In the example you send me, a cart appears on the right sidebar, so the customer can see that the product has been added. But, in the case of a store without a cart in that position, how can the customer know what has happened? Shouldn't we show "Sticky Add to Cart Panel" on the product page as well?

These are doubts that I raise with you for future projects, since GeneratePress is the template that I use as a reference in my work.

Thank you very much for everything and congratulations on your work.

The reason we don't have an "added to cart" panel on single product pages is because they don't use AJAX - they refresh the page and show a static message with a button to the cart.

If WooCommerce had an option to set AJAX on single product pages, we could likely integrate our added to cart panel with it.

Thanks!

This archived topic is closed to new replies.