Cart page RG stays empty even though I add products

Hi everyone :waving_hand:,

I’m building a simple e-commerce in Bubble.
My model: a Cart type with a field products (List of Products).

Goal

  • Clicking “Add to cart” → add product to the active Cart.

  • Clicking “Cart (0)” → navigate to the Cart page, which should display products in a RG.

:backhand_index_pointing_right: Problem: the Repeating Group on the Cart page stays empty.


:small_blue_diamond: Current workflow

  • If no Cart exists → Create a new Cart (products add Current Page’s Product, status = en_cours, user_temp_id = Current User’s unique id).

  • Else → Make changes to Cart (products add Current Page’s Product).

  • I also store the Cart in a custom state PanierActif.

  • The “Cart (0)” button → does a Set state PanierActif via a Search, then Go to page Cart (Data to send = PanierActif).


:small_blue_diamond: Expected

The RG on the Cart page (type = Product, data source = Current Page Cart's products) should list products.

:small_blue_diamond: Actual

The RG stays empty. But in App data, the Cart is created and sometimes products are added to its products list.


:small_blue_diamond: Question

Do you think the issue comes from:

  • Type of content / Data to send setup on the Cart page?

  • Missing constraints in my “Make changes to Cart” (not always filtering with user_temp_id + status)?

  • Wrong RG data source (Current Page Cart's products)?

  • Or Privacy rules?

I’m attaching all screenshots in order. Thanks a lot for your help :folded_hands:

Hi there,

The screenshots you’ve shared of your workflow are coming through low resolution, so it’s hard to make out how you have this setup. Are you able to share some higher-resolution screenshots?

Since I couldn’t tell in the screenshots - how are you ensuring the user is on the current page’s cart? Are you sending the Unique ID to the URL and going to the cart page upon creation (i.e. /cart/1756437146753x835618375849738200)? If not, what you may want to do instead is to create a cart on current user, and then make changes to current user’s cart. The Repeating Group for cart should show current user’s cart’s things.

2 notes for you - 1. in general, if repeating groups have a data source based on Do A Search For, or a List of Things, they should update dynamically as the data source changes 2. Custom states do not update automatically, nor do they carry over from page to page (going to another page will clear out your Custom State), so they’re best for same-page interactions but not something like a shopping cart.

Hope this points you in the right direction!

Thanks a lot for your help :folded_hands:
I’ll test your method (attaching the cart to the Current User and/or passing the Cart ID through the URL). That definitely seems cleaner than what I was doing with custom states.
Sorry about the screenshot resolution, I’ll try to upload higher-res ones next time so it’s easier to read. Really appreciate your guidance, this is very helpful!

1 Like