DUPLICATE: Add to cart redirects to me to the product page instead of adding the product to the cart

Bricks Version: 1.5.6
Browser: Chrome 90
OS: macOS / Windows / Linux / etc.
URL: (a link to a page that illustrates the issue would be really helpful)

If I use an add to cart element on a single page (not product page) inside a query loop, when I add the product to the cart I get redirected to the product page instead.

The issue is visible on the first bundle at the bottom of the page, second ATC element. The others are made with Bricks ultimate ATC element, but the result is still the same.

I fixed it for you.

Steps:

  1. Disable the loop option
  2. Enable the ā€œAjax add to cartā€ action

thanks my issue has been fixed.

Hey @Adrenaline22 ,
The issue has already been reported here: WIP: Woocommerce 'add to cart' in shop page loads product page - #5 by kappesante

Can you please be a bit more detailed @bricksultimate ?

Best regards,
timmse

i’ll reply here just because this thread is the newest.
i’ve just found plugins enabling the ajax thing both in the query loop and in the single product pages, and some are free, preventing the loading of both pages (quite handy). i can’t speak php, but they work.

BUT if we are able to make it work without a plugin i’ll be very happy. the ā€˜disable the loop’ is not clear anyway, because the loop is exactly what we need if we want to populate a product list designed by hand. if your solution works in every page, but not in a query loop, the issue is sadly still live and kickin.

Hi timmse

I resolved this via my add-to-cart element. He is using my add-on also. Those two options are in my element. I setup the options and all are working as per his requirement.

Thanks
Chinmoy

I am not talking about the Bricks query loop builder. My element has the option ā€œAre you using inside the Bricks query loopā€. It is an on/off option and I did some work based on this option. That’s it.

i’d like to try your package, you got some interesting stuff. but it’s now a subscription, and it’s not cheap. i missed the ltd maybe. 100 one time seems nice, 130 every year, well, if i found 130 on the ground count me in. for a year.
i also messaged your team days ago, asking if your add to cart button actually works like i need, but no answers yet.

anyway: i think that the whole topic here, and in my original post, was about to understand if the current behavior is a bug or not, and how to fix it.
is it normal that if you put the add to cart (default) button in a query loop, it loads the product page?
do we have to fix it subscribing to a whole package, from you or from other developers?

Sorry! Maybe I missed your email or I did not get it.

Yes. I changed the price plan and am going for a yearly subscription. No extra discount option(BF/CM deal). Users will get a 30% renewal discount only.

It was not a bug. Element is not configured the right way. If you want, then the element can go to the product page. There has an option for redirecting URL. You can set any redirecting URL(like cart/checkout page) there.

so, with the module in your pack, i can set it to not reload the single product page or the shop page or any page with a query loop and the button in it, right? i can set any quantity, add them to cart, without loading the single product page? am i correct?

Yes. 100% correct. See this video Changing Add To Cart button text to Added on Added state - YouTube Page is not refreshing. I used the query loop builder.

slick, i admit. good job.

1 Like

I can’t really follow the progression anymore, but is your problem solved with this @Adrenaline22 ?

I solved it with Bricks Ultimate element. The problem with the native Bricks ATC is still present.

i’m trying ultimate too, inside a dynamic lightbox from bricks extras. the act button does not work properly. i’ve emailed you, and also the guys at extras. they said:

I’ve realised you’re using a different plugin for your add to cart, not Bricks defaults.

I took a quick look at the JS from that element, and found a function called ā€˜buatcdoajax()’ that seems to add the functionality that is needed on page load, you may need to confirm with the developer, but from our end any code can be run when a lightbox is opened using the ā€˜x_lightbox:open’ event. (mentioned in the docs)

So putting these together, adding this JS to your page…

This will run that function any time the lightbox is open, so that specific functionality should work correctly.

i have issues about the + and - button not clickable, and i cannot customize the act button as i want, for example i can’t set a margin between the quantity and the button.

i’ve set up a staging environment:

https://agridev.lanuovaarca.org/negozio/

Hey kappesante,
Please reach out to bricks extras or any other third-party dev directly if you have any problems with their plugins :slight_smile:

Since the actual problem has already been reported, I will close this thread as it does not help solve it. I appreciate your understanding.

Best regards,
timmse

1 Like