I’m going through the forum since last night for help related to cart, all those answers made me feel little bit dizzy to be honest.
What I’m looking for is adding cart to the temporary user, before they login.
How can we do that? Someone said use session ID, someone said bubble will create temporary user profile for everyone, someone said use IP address etc etc.
Someone who’ve done this before, please help me!
You are wanting to add your cart products to guest user if no user is logged in?
May I know the exact scope for your requirement? So that I can provide my suggestions may be help you.
Do you want retain the user cart after they revisiting your website?
If yes then just create temp user into your user table and use jscookie to store that temp user. After user revisiting your website check for cookie and retain their cart products
So, for your situation, you would create a shopping cart as normal for any other user. You need to ensure you have the database structure for that.
You should have data type of products, datatype of order and data type of line items. Line items is the product related, the number of quantity and the related Order. The order has a list of the line items.
If you are interested in getting a shopping cart setup properly, both from the database structure, workflows and the UI elements, I’d be happy to assist you with the task. I believe we’d be able to cover all the nitty gritty details in an hour session and have time for you to ask any clarifying questions so you’d be ready to implement.
Boston85719 is an expert Bubbler with a decade experience as an educator. Real name Matthew, he has been actively building SaaS apps, marketplace apps, scheduling apps and more for clients, himself and for sale as templates.
As an official Bubble Bootcamp Instructor, he leads Bubble Bootcamps on a regular basis.
Always willing to offer advice via the Bubble Forum, Matthew also offers Private Personal and Group Training Sessions.
Be sure to checkout the Stripe Integration Course when you are ready to integrate Stripe payments to start monetizing your application via product sales or subscriptions.
I want users to add products to the cart even though they’re not logged in, while redirecting them to the check out page, I’ll ask them to login. They I want to display this cart in check out page…
For this case, don’t need temp user unless your not using privacy rule for cart table. Maintain some custom state for cart products to show on your checkout. Once user try to login or register move those cart details to that user and process the order.
Can we move items from state to database?
Yes, you can. with help you backend workflow/ custom trigger.
Somewhat understandable now. Thank you so much man.
I’m trying to push list of items from custom state to the database. I’m having some issues. I’ll try to sort them out myself. If I couldn’t, I’ll get back to you
Ok sure and thanks happy to help you.
So I’m having list of food items in the custom state. Food-item is a datatype which contains Food item name, it’s price and its picture. Now I’ve created two datatypes namely “Cart” and “Cart-items”. Cart contains Customer which is of type user and items which is a list of Cart-items. Cart-items contains of Food-item which is of type food-item, quantity which is of type number and cart which is a link to the cart these items are part of.
Now I’m trying to move the list of food items from custom state to the datatype “Cart”. I’m setting customer=current user and items=custom state’s name(list of food-items). I’m getting error saying items should be a list of Cart-items but rn it’s a list of food items. Cart-items is having the food-items in it. Any help would be greatly appreciated.
Dont make more complex. Just create some temp table for maintain the cart-items (list of food-items, price, quantity etc) and store this thing to the custom state as list.
Use this custom state to listout in checkout page.