1

I have a onepage checkout and need a way to get every step while clicking through the checkout. As the page is completly loaded I guess I can only use JavaScript.

checkout.accordion.currentSection;

That is so far my only achievment. But every time I click forward and back in my checkout there is no further response from this row. How can I achieve this with JavaScript?

1

1 Answer 1

4

Try the below code, it works

In checkout/onepage.phtml,

To get the current section only when loads

 console.log(accordion.currentSection);

To get the current section when change section in checkout

 Accordion.prototype.openSection = Accordion.prototype.openSection.wrap(
    function(parentMethod, section) {
        // Call parent method
        parentMethod(section);
        console.log(accordion.currentSection);
    });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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