Saving order items with shipping record
Saving order items with shipping record
I am building an AC order object manually by translating another data object into an AC object. When building the order children, I was looping through my items and doing an Order.Items.Add to get the items on the order. Then for the shipping child object it also wants the items, so I looped through the items and added them to the shipping object. When I save the order object, I get duplicate items in the OrderItem table (one with a shipment ID and one without). I removed the code that added the items to the order and left the code that added the items to the shipment object and that seems to work. I'm wondering if this is the correct way to get the items associated with the order or is there another way I should be associating the items with the order so I can get them correctly associated with the corresponding shipping object? It just didn't seem logical to me that I would NOT add the items directly to the order, so I'm a little nervous with my solution. Any insight would be appreciated. thanks.
Re: Saving order items with shipping record
Not sure how your method will work ultimately, but I was able to create orders starting with the user first, and then populating the User.Basket with items, and ultimately running User.Basket.Checkout method.
Scott
Scott