Developer forum

Forum » Development » Cart only supports cart items exception

Cart only supports cart items exception

Rui Silva
Reply

Hi,

We been experiencing some issues with orders completed that try to load into ecommerce context and when this happens it will give us an exception:

 

This is happening in two different solutions, one in DW9 (9.3.8) and the other in DW8 (8.9.2.20). The DW9 solution does not have cart context but the solution in DW8 uses cart contexts. In either of them we can’t setup a repro scenario to debug or get more information on it.

Since we can’t reproduce it we tried to get some clues from the source code and found that the only place where the card id (in the user session) is written is in the save method of the order (in the more recent version of DW in the order service save method).

Considering that this method uses the Order object in memory we are guessing that something can be happening that damages it and will make the IsCart property to have a true value, this will mean that the user/ordercontext will have an order id of a complete order written in database.

Does it make sense to have an extra check before writing into the database if the order id is an order complete? In this case write something in the order log and avoid the update of the user/ordercontext.

Could we also log more details of the order before the ApplicationException in the CartCatch.vb file?

 

The two solutions where this has been happening do not use the same payment handler and this only happens with orders that are paid with a credit card.

In the back office some of the orders that were generating this error for the user show all the steps like a regular order, but others seem that stop flow of order complete, see dumps:

 

If you need any extra information let me know.

Best,

Rui Silva


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Rui,

What we have discovered is that the error is rendered if OrderIsCart = true and one of the following:

order.Complete, order.IsLedgerEntry, order.IsQuote or order.IsRecurringOrderTemplate

And usually it needs to be referenced in the AccessUser table on AccessUserCartID.

Maybe this will help you if you have not discovered the solution in the meantime :)

Adrian

 

 

You must be logged in to post in the forum