Related or unique shopping cart

I am creating a local app that communicates a business and a customer by whatsapp but I need to have a shopping cart that only accepts products from the same store and does not allow adding from several, so that the order message reaches a single business by whatsapp.
Someone help me who knows how to do it or has any idea thanks

Basically it’s the same idea as above, but for each “Cart item” you would have the “Business rowID” in there as well.

In your User Profiles table, create a relation to check for un-submitted rows, and return the business rowID (a single value column).

If the user is trying to add an item with a business ID different from their “currently added business ID” as described above, then you don’t allow them to add.

1 Like

So I would have to create a new cart table where the orders arrive?


So I have made my tables in orders I call the user, quantity and all that and I have a relationship with the unique product code and where in the cart I only put that relationship

I assume each row in your screenshot is an item in the order?

1 Like

yes

Then you just need to add a column to capture the business ID, and follow my explanation in the first comment.

whit relationship? or single value? sorry for the noobs questions, and the BussinesID not is necesary in the product table? (and how :frowning: )

I assume you’re letting your users add items to the cart. Your Items table should contain a business ID related to that item (that would be added when you as an admin add the item to the database).

Then, when your users add items to the cart, capture that business ID as a new column.

I am traying make relation in “pedidos” to column “codigo bussines to ID bussines” but the code its not visible