I don't know any module, however you could find a way to include or reorder the checkout process as explained below. It could help you to develop a solution.
I wanted one day add a step in the middle of the checkout process. At the moment, there is no official way to do it, I mean you don't have any events which allows to change the behavior.
The solution I found consist to modify the class Mage_Checkout_Block_Onepage_Abstract
. Attention, it's not a classic model, it's an abstract, you can't overwrite it by using the tag <rewrite>
in config.xml
file.
So, you have to copy the file app/code/core/Mage/Checkout/Block/Onepage/Abstract.php
to app/code/local/Mage/Checkout/Block/Onepage/Abstract.php
, edit the file by adding (if you use Magento 1.5) or editing (if you use Magento >= 1.6), the method _getStepCodes
as showned below. In this case, you can change the order of the steps, add your own or remove steps. Take care of the consequences of such changes.
abstract class Mage_Checkout_Block_Onepage_Abstract extends Mage_Core_Block_Template {
...
/**
* Get checkout steps codes
* diglin - method took from Magento 1.6 but add a dispatch and $transport to allow to hook the code
*
* @return array
*/
protected function _getStepCodes()
{
$data = new Varien_Object();
$data->setStepCodes(array('login', 'billing', 'shipping', 'shipping_method', 'payment', 'review'));
Mage::dispatchEvent('checkout_onepage_stepcodes', array('transport' => $data));
return $data->getStepCodes();
}
}
EDIT
The code I provide here was a code proposed to Magento core team to allow customized steps, that's one of the reason why the Mage namespace and the Abstract are used.
The block checkout/onepage
class is also rewritten:
class Mage_Checkout_Block_Onepage extends Mage_Checkout_Block_Onepage_Abstract
{
/**
* Get 'one step checkout' step data
*
* @return array
*/
public function getSteps()
{
$steps = array();
$stepCodes = $this->_getStepCodes();
if ($this->isCustomerLoggedIn()) {
$stepCodes = array_diff($stepCodes, array('login'));
}
foreach ($stepCodes as $step) {
$steps[$step] = $this->getCheckout()->getStepData($step);
}
return $steps;
}
public function getActiveStep()
{
// diglin - add the $stepCodes to provide custom step
$stepCodes = $this->_getStepCodes();
return $this->isCustomerLoggedIn() ? $stepCodes[1] : $stepCodes[0]; //custom / billing Step or Login Step
}
Try to rewrite below block files with following functions:
Rewrite class Mage_Checkout_Block_Onepage_Billing
public function canShip()
{
return false;
}
Rewrite class Mage_Checkout_Block_Onepage_Shipping_Method
public function isShow()
{
return false;
}
Rewrite class Mage_Checkout_Block_Onepage_Shipping
public function isShow()
{
return false;
}
I hope now issue related to progress will not occurs.
Best Answer
Here is what I've done.
I removed the shipping step and used a default shipping method that I know is always going to be available.
Not sure if this is what you need but you can at least use it as a starting point.
Here is my idea.
I created a new module with an
enable/disable
shipping step config setting, so you can always re-enable the shipping step from thesystem->configuration
section.So create the module
StackExchange_Checkout
.You will need the following files.
app/etc/modules/StackExchange_Checkout.xml
- the declaration fileapp/code/local/StackExchange/Checkout/etc/config.xml
- the configuration file where you define models, blocks and rewrite the onepage checkout block. Also it sets a default shipping method.app/code/local/StackExchange/Checkout/etc/system.xml
- the system file that places the enabled/disabled flag for the shipping stepapp/code/local/StackExchange/Checkout/Helper/Data.php
- the helper that checks if the shipping step should be disabledapp/code/local/StackExchange/Checkout/Block/Onepage.php
- the overwritten checkout blockapp/code/local/StackExchange/Checkout/controllers/OnepageController.php
- override the onepage controller to set automatically the default shipping method.Clear the cache and you are done.