The default Magento onepage checkout includes six steps for the customer to complete. However, sometimes you may have a requirement to create an extra checkout step. An example of this might be an option for your customer to choose a free gift as part of their order, or an extra step to collect special delivery instructions. Using delivery instructions as an example, we’ll demonstrate how this can be achieved.
The first file we need to modify is
app/code/core/Mage/Checkout/Block/Onepage.php. Obviously we don’t want to modify the code in the core context, so copy the file to
/Mage/Checkout/Block/Onepage.php. Magento will use this file automatically.
getSteps() method of this class there is an array of the step codes, in order of viewing. We need to add our own step code in this array, in the relevant place. For this example, the code will be
deliveryinstructions so we will change the line to be this:
$stepCodes = array('billing', 'shipping', 'shipping_method', 'deliveryinstructions', 'payment', 'review');
Next, we need to create a new file -
app/code/local/Mage/Checkout/Block/Onepage/Deliveryinstructions.php. As you can see from the name, this is the block file that runs our new step. You can use this class to do any special setup work for your block, but more than likely all you’ll need is this:
class Mage_Checkout_Block_Onepage_Deliveryinstructions extends Mage_Checkout_Block_Onepage_Abstract
protected function _construct()