Developer forum

Forum » Development » Removing orderlines from basket when added via API fails

Removing orderlines from basket when added via API fails


Reply

I have a setup where it is possible to add products to the basket not available in Ecommerce product catalog. I'm doing this via the API (see thread: http://developer.dynamicweb.dk/Forum-17061.aspx?action=ShowThread&ThreadID=1309 )

 

When I have added some products to the basket,  in my test at least 2 items, and I try to remove/delete an item from the basket it is always the first item in the list that is remove/deleted.

I have with SQL Profiler tried to track the database commands for any clue to why this is happening.

 

I have together with support tried to eliminate all possiblities of template error, and in the test i found out that with a standard product catalog with a standard basket it works. The only difference I can see and somehow conclude is that when products from the ecommerce product catalog are added the standard way the basket behaves perfectly, if I add some products manually via API, the basket doesn't work.

 

I have compared the database entries of my products in EcomOrderLines and even if I make them almost equal it doesn't work.

 

The only way out I see at this time is to the remove/delete command manually directly on the data tables.

 

 


Replies

 
Reply

It is a bit difficult to provide any guidelines based on the description alone. Is it possible to see it in action?

 

When cart items are removed, ecom removes the first order line in the cart where the id matches the key parameter passed in query string or form. In you case the first two lines are moved. Could it be that, there is no ID on your order lines in the database, and you're maybe exposed to the "code runs twice" problem?

 

Have you tried hooking up to the Dynamicweb.Notifications.eCommerce.Cart.Line.Removed notification? You might be able to finde something useful from its Cart or RemovedLine properties.

 

 

You must be logged in to post in the forum