How to get the current step of checkout page on website

The Checkout component lets you manage the steps in the checkout flow. For example, you can get the current checkout step, go to the next or previous steps, and add or remove steps in the checkout flow.

Get an instance of this component by calling container.getComponent("Checkout").

Returns a Deferred object. If the promise is resolved, it returns a CheckoutStep. If the promise is rejected, it returns an error. Use the .then() and .fail() methods to work with the resolved and rejected state of the object.

Use this method only after the checkout page has rendered – you can listen for the afterShowContent event to do this. Otherwise, this method returns undefined.

checkout.on(“afterShowContent”, function() {

   checkout.getCurrentStep().then(function(step))

})

Leave a comment

Your email address will not be published. Required fields are marked *