1

I got all of the steps using this:

Mage::getSingleton('checkout/session')->getData('steps')

But how do I get the current step? Not in prototype or js. I want it from PHP. I am using onestep checkout and ajax to get to the next step.

  • onestep checkout ?? means.. you do not using magento default checkout!! – Amit Bera Feb 23 '17 at 15:06
1

You can use the complete value from the step data. So in your case, you'll have to look through the steps and check them:

$steps = Mage::getSingleton('checkout/session')->getData('steps');

foreach ($steps as $step) {
    if (Mage::getSingleton('checkout/session')->getStepData($step, 'complete')) {
        continue;
    } else {
        break;
    }
}

Current step will be the value of the $step variable after running that code.

  • For some reason I get false. The getStepData returns me false. my phtml file is include from xml: <checkout_onepage_index> – Attila Naghi Apr 20 '17 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.