Do you have 3 data types or 4 data types? I assume the Cart is a typo and that you have only 3 data types and those are User, Product and Shopping Cart.

You will need a data type of Order Line Item so that you have fields of Product and Quantity to track how many of one product the user has selected. There should also be a data type called Order. You would want to have a field on Order Line Item related to the Order data type…this means if a user has 5 products, you create 5 Order Line Item entries and one Order entry.

Doing that, you can essentially omit the data type of Shopping Cart or instead just rename it to Order…you also want a field for Status on the Order data type so you can determine if the Order is basically a shopping cart (status might be ‘Pending’) and then you’d change status to ‘Paid’ once the user has checked out…then when the user returns and wants to add another product to their ‘shopping cart’ you can create another Order entry and the relevant Order Line Item entries.

1 Like