I’m trying to create my first app with a client for purchasing. I’m struggling with the logic.
I have the following Tables:
Users
Products
Order Items
Orders
When a user clicks the product, they can add to basket (Adds an Order Item), they can keep adding to basket and will create Order Items.
When they go to the basket they will see a list of these order items and can purchase using stripe. This will create an Order.
This bit I can do but I want to then update all the current Order Items for that user with the Order number (From the Orders Table). I can’t seem to do this. am I doing something wrong? is the design wrong?
No you’re not doing anything wrong. Batch actions, as we call them, are currently not possible with Adalo. BUT - you can change the workflow around so that the order is created first, before any items are added. This will allow each Order Item to have the Order number assigned to them as they are added.
I did think about that but wasn’t sure at what point to create the order. Ideally, it would be when the first item is added but then how would I define the first item?
When or how would you suggest doing this? it’s unusual for a user point of view to create an order first. Are there any clever ways of doing it?
Yes it can definitely feel strange, but the user’s don’t care about the backend really. They just care if it works. Let me work up a quick video for you.
That’s great, I really appreciate you taking the time to do that. I think that will solve the problem, maybe I can I have a “shop” button that creates the order and deletes it if they back out as you described.
Last question I had planned on having an Order ID using the Orders>Count + 1 method but I worry about order numbers being replicated if orders are deleted. Is that an issue here? is there a better way to generate order numbers?
I will attempt to replicate what you demonstrated. Thanks so much