Bricks Loop with Add to Cart Popup for Variable Products

Hi everyone!

On a shop page I’m building, I created a product loop using Bricks, and added a cart icon that lets users add simple products directly to the cart using the ?add-to-cart={product_id} URL method. It works perfectly for simple products.

However, for variable products, I decided to open a popup that lets the user select a variation and then add the product to the cart. That part is working too — the variation gets added — but after clicking the add to cart button inside the popup, the page redirects to the single product page.

Ideally, I’d like the user to stay on the shop page after selecting the variation and adding it to the cart. Has anyone run into this issue before? Any tips on how to prevent the redirect?

Thanks a lot!

Great question, @Peppej1086. I would like to know the answer, too.

1 Like

@Peppej1086, how did you set up your popup? I’m trying to build something similar, but I’m running into issues with loading the product details dynamically. My popup doesn’t show the correct information for the selected product—it just shows the wrong data. Could you share how you managed to get it working?

Hi @kristijan.bruck ,
Your popup probably isn’t working because of the settings — try adjusting them like in my screenshot. Let me know if it works!

Thank you, @Peppej1086! It is working now!

1 Like