Hi guys,
I have a situation where I do all sorts of fancy stuff in the EcomCartOrderIsPassedToCheckoutHandlerObserver
As a last step in the EcomCartOrderIsPassedToCheckoutHandlerObserver I send the order to another system.
Now I need to implement a new feature.
The passing the order to the other system now gives me a response and I need to react to this response.
If it tells me the order couldn't be processed on their end I still want to show the following (last) cart page (on which I want to show a corresponding message), but I do not want the order to be finalized.
I saved the response on the order, so I can use it in the last cart page to show a message, that works.
I tried to keep the order open by setting:
order.IsCart = true;
order.Complete = false;
order.Save();
But that results into a completed cart with the IsCart set to true
I noticed there are observer templates called "CartCheckoutDoneIsCompleteObserver" and "CartCheckoutDoneIsNotCompleteObserver", so I think the Dynamicweb order completion functionality is somewhere between these observer moments. My settings to "uncomplete" the order in the EcomCartOrderIsPassedToCheckoutHandlerObserver is too early.
But I can't figure out how to prevent this action and still end up on a page after the EcomCartOrderIsPassedToCheckoutHandlerObserver being able to show a message and give the customer the opportunity to do things with his cart. (now they end up with: "whoops something went wrong" and an empty cart)
Can anyone push me in a right direction here?