Developer forum

Forum » Development » How to go to next step af Redirect is called in a custom CheckoutHandler

How to go to next step af Redirect is called in a custom CheckoutHandler

Martin Slot
Reply
Hello

I have this redirect method

       public override string Redirect(Dynamicweb.eCommerce.Orders.Order order)
        {
            string orderStatus = HttpContext.Current.Request.QueryString["order"];
            if (orderStatus == "complete")
            {
                LogEvent(order, "complete");
                base.SetOrderComplete(order);
                base.CheckoutDone(order);
            }
            else
            {
                LogError(order, "transaktionen fejlede");
                order.TransactionStatus = "failed";
                order.Save();
                base.CheckoutDone(order);

                return PrintErrorTemplate(order);
            }

            return PrintShowThanksTemplate(order);
        }


But no matter what I do in the return, the comes no output. My order is set to complete, customers and shop get their email, but I am not sent through to the next step. My Print methods just renders some templates, but I have tried to return the empty string and null. No one of these two sent me to the next step in the flow. I have not found anything in the Checkout Handler pdf, that tells me what to do. So can anyone tell me how to do it?

Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Martin

You need to tell the Cart that it should take over again if the order was completed successfully. Inserting this at line 9 should take care of that:

base.RedirectToCart(order);
return null;

This will redirect the user to the first step after the Checkout step and render the template associated with that step. The return string is only used for printing error messages or in some other way to halt the cart flow.

Hope this helps :)

- Jeppe
Votes for this answer: 0

 

You must be logged in to post in the forum