In my shopping cart once and item is removed it cannot be added again please help

Once the user clicks clear list or removes the product it cant be added back to the shopping cart from the products page. How do i fix this?

This the workflow

This is the workflow that removes cart items

You’ll need to include more info on how your app is setup so others can understand what’s happening. Can you share screenshots of the workflow that adds a product to the cart, and of the workflow that removes it?


Complementing @msgiblin great advice I suggest that you check the search expression that loads the cart line items to the cart. I presume that the line item holds the product …

Check for the necessary status or logic that removes/adds them

I have shared the necessary screenshots.

1 Like

Thanks for sharing the screenshots - going through your Workflow logic, it seems there’s some unnecessary constraints that may be contributing to the issue.

For instance, I noticed you create a new Cart item 'only when: Search for Cart items:count is ≤ 0. What happens when you try to add more than 1 items to the cart? It seems this ≤ 0 would prevent more than 1 item from being added.

I also noticed that when you add to cart, you are adding to Current User’s Shopping_cart’s Cart_item. But when you are removing, you’re removing from Parent group’s Cart item. Based on what I’m seeing, it looks like you are adding to a type of Shopping_cart on the user, but you’re removing from User’s cart_item. What I believe is happening is now your Search for Cart items:count is ≤ 0 is finding a count of 1, so it’s not creating a new cart-item to add.

What I’d recommend doing is mirroring your workflow logic for both adding items and removing items. If you are creating a new cart-item, and adding that to User’s Shopping_cart, then when you remove it, remove that cart-item from that User’s Shopping_cart. I’d also recommend looking into whether you actually need that ≤ 0 count on creating a cart item.

1 Like

Its still not working for some reason once i remove something i cant add it back.

and the ≤ 0 count is so that the same product does not get added twice , i know its inefficient so if theres a way to add the quantity to the existing cart item i would love to know how.

Ive also run into another problem now where the cart items are not being displayed on the checkout page and when i click remove cart item nothing happens
Heres the viewer constructCO | Bubble Editor

I would recommend re-working your Add to cart logic.

Instead of ‘Make changes to current user’ to add the cart item, I would instead add the cart item to the Result of Step 1 (Create a new shopping cart). Additionally, the ≤ 0 count you have seems it would apply to ALL items in the cart, meaning after 1 item, I don’t think that would allow any more items into the cart. I think instead you would need some more advanced logic, like If Current Cart Item Is In Current Shopping Cart’s Cart, increase quantity by the sum of both values. I haven’t worked the exact logic but I expect it to be along those lines.

This tutorial is a bit simple but I think the basics might help you get there with your current layout:

This topic was automatically closed after 70 days. New replies are no longer allowed.