Monday, November 22, 2010

Guest Checkout Failing in Ektron Checkout: Debugging the Checkout process

We’d added some custom logic to the Checkout process (changing order of steps, showing extra information, additional resource strings) but were getting an error with the guest checkout. The order would complete, but user was stuck with the spinning loading image thingy.

 

Repro steps

1. Add item to your basket and go to page with Checkout control.

a. Expected and actual: User is shown initial checkout page, with “Returning customer”, “New customer” and “Guest Checkout” options.

2. Click Guest Checkout – “Checkout without profile”.

a. Expected and actual: “loading” image appears, then user is taken to Billing details page.

3. Fill in details and click “Continue”

a. Expected and actual – “loading” image appears , then User is taken to Payment Details page

4. Fill in payment details - "Visa", "4444333322221111", "999", "12", "2019" - and click process payment

a. Expected: loading image appears, then user is taken to order completed page, completed order is listed in Workarea

b. Actual: loading image appears. User is stuck with loading image. Completed order is listed in Workarea.

Network Responses (from Firebug)

Working

0|EKTRON_PACKET_START|1|0|268|#EktronCheckout_Checkout1

0|.EktronCheckout_WizardMode|1|<div class="EktronCheckout_OrderComplete

0|EktronCheckout_ProcBlock"><h3>Order Complete</h3><p><b>Thank

0|You!</b></p><p><b>Order ID<span

0|class="spacingContainer"></span>10034</b></p><p>Your order has been

0|approved, you will receive a confirmation email shortly.</p></div>

Broken

0|EKTRON_PACKET_START|1|0|0|#EktronCheckout_Checkout1

0|.EktronCheckout_WizardMode|1|

 

The standard control was working, and the problem was narrowed down to the handler for the PreProcessXml event. The offending line is -

if (Checkout1.CurrentPhase == Checkout.ControlPhase.SubmitOrder)

This was being used to conditionally alter the XML depending on the phase. The Checkout1.CurrentPhase code is what is causing the problem.

 

I was also intermittently getting the following build error-

'Checkout' does not contain a definition for 'ControlPhase'

which seems to be due to an ambiguous class reference that the compiler/intellisense is missing. This was fixed by cleaning up the “using” statements.

 

I tried using the full namespace of Ektron.Cms.Controls.Checkout.ControlPhase, however, the Guest Checkout still did not work.

I should be able to get the current phase some other way – possibly via the event args. But for now, I am avoiding the phase checking in the PreProcessXml event handler.

No comments:

Post a Comment