Developer forum

Forum » Development » Dynamicweb.eCommerce.Common.Context.Cart not available after recycle

Dynamicweb.eCommerce.Common.Context.Cart not available after recycle

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

 

Inside a subscriber CheckoutDoneOrderIsComplete I am trying to access Dynamicweb.eCommerce.Common.Context.Cart. I noticed that sometimes this returns null; for example when viewing the cart page, recycling IIS and then completing the checkout. It's weird as the order info displays correctly. Also, inside the subscriber args.Order contains a valid order.

 

Is this an issue that could explain some other issues we're seeing which changes orders (IDs, language) and so on? Shouldn't Context.Cart be repopulated with the current cart info?

 

Imar


Replies

 
Nicolai Pedersen
Reply

When you are in CheckoutDoneOrderIsComplete there is no longer a cart - it has been converted to an order. So never touch the Context.Cart from there - that would surely mess up stuff.

You can see something there when you have set the "Keep cart in context" since the cart will not be removed when order is complete. But nor should it be manipulated at this time.

Why would you need a cart when in CheckoutDoneOrderIsComplete notification? Is it not the instance of the order that was just completed you need?

 

You must be logged in to post in the forum