Magento Adding Step to Onepage Checkout

magentomagento-1.7

I'm attempting to add a very basic (literally just a div with some text and a continue button) step to the onepage checkout but have come up short, in that they don't work (i suspect it's because they were created prior to 1.7.0.2), when following the examples here (Fontis), here (inchoo) and here (Magento Forums).

I've also tried to combined bits from different examples and forum posts but i've gotten no where in the week i've been attempting to do this.

I have been recommended the book 'Php Architect's Guide to E-Commerce Programming with Magento' which i've purchased and will begin reading but i was wondering if someone could kindly point me in the right direction in adding a new step to 1.7.0.2's onepage checkout?

Much appreciated for any help!

Best Answer

I have done this successfully in 1.7.0.2 following this guide:

http://www.excellencemagentoblog.com/magento-onestep-checkout-add-step

In summary, you need to extend/override Mage_Checkout_Block_Onepage::getSteps() to add your new step in the sequence.

Create your new step's block/template (loaded using an Ajax request when the previous step is completed) Your block class will need to extend: Mage_Checkout_Block_Onepage_Abstract

You also need to extend the onepagecheckout javascript as this does much of the heavy lifting. The Prototype library has a nice way of doing this.

Finally you will need to extend the controller class (Mage_Checkout_OnepageController) to override the responses of any existing steps, return the content of your new step (loaded using ajax), and handle the save action of any data (form fields etc) entered in your new step.

Related Topic