Setting relationships on shopping cart

Hi,
I have been trying to solve a problem, simple, but can’t get it to work.
For sure my approach is wrong, but can’t find where…and trying what I found here didn’t work.

On my webpage registered users can browse and pick products from a catalog.
Each one they add to the cart a new line on OrderItems is created.
Later, after all the items are in the cart and the user decides to pay, he goes to the shopping cart and confirms the order.
At this point I create a new Order record to “group” all the items and store all the Order info.
There is the problem. The Order record is created ok, but can’t manage to link the many OrderItems to the Order.

As you can see on the image:


that is how I am linking, or better said, hoping to link both tables.
After running this I get no link. Anyways I am guessing how will this work since this is supposed to link all the records, and there is no way to filter…so the second order will contain all the Items in the first order too.

Is there something I am missing?
Thanks for your help!

It’s really hard to say from the information provided. You want to make sure your collections have relationships to each other.

Are you able to give out a cloneable link to toy around with?

Hi @Bobby , if you share your email with me I can add you as editor and you can take a look…
The collections have a relationship set, but I may have done it wrong…
Thanks!

support@mlmediasolutions.com