20
Views
3
Comments
Solved
I can´t create one order if it is more then one product in cart
Question
Application Type
Reactive

Hi,

I can“t create one order if it is more when one product in cart, it will create an order for every product.





Skärmbild 2023-03-22 194435.png
Skärmbild 2023-03-22 194749.png
Skärmbild 2023-03-22 194825.png
2023-10-21 19-42-11
Tousif Khan
Champion
Solution

So what you can do here , when you are ready to create an order for the items in a cart,

Create the order with all the details which are required on your order table, Once the order is created now you have an Order Id which your Create Order action will return. Now For each of the products (order Items) pass the same Identifier order Id that is created to the reference attribute of an order detail Extended entity so it will loop with all the product that is in your cart that have a product Id but the Order Id remain same for each record that get created.

hope this helps

2023-10-21 19-42-11
Tousif Khan
Champion

Hello

Can you share your data model, ER diagram that can help us understand how you are doing this

Thanks

2023-03-09 20-01-05
Christofer Ekman

Here is it

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

So what you can do here , when you are ready to create an order for the items in a cart,

Create the order with all the details which are required on your order table, Once the order is created now you have an Order Id which your Create Order action will return. Now For each of the products (order Items) pass the same Identifier order Id that is created to the reference attribute of an order detail Extended entity so it will loop with all the product that is in your cart that have a product Id but the Order Id remain same for each record that get created.

hope this helps

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.