Saving order items with shipping record

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
derekz
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 38
Joined: Mon Nov 03, 2008 3:13 pm

Saving order items with shipping record

Post by derekz » Tue Feb 17, 2009 12:07 pm

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.

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Saving order items with shipping record

Post by heinscott » Tue Feb 17, 2009 12:28 pm

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

Post Reply