Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it?
I'm working on a payment module and have a sort of "cancel" action that i would like to return the user to the step in checkout where you choose the payment method.
I currently return the user to the first step of the checkout like so:
$this->_redirect('checkout/onepage', array('_secure'=>true));
Another issue with this is that i does not work all the time, in certain browsers i'd really not like to name this sort of works "sometimes". Is that something that is known and/or commonly accepted? I have very little actual information regarding this, but i've had complaints from customers about this behaviour. They generally won't give me any specifics so it's kind of a dead end.
In PHP
$step = Mage::app()->getRequest()->getParam('step');
$stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review');
if (($step) && (in_array($step,$stepCodes)) && ($this->getActiveStep() == 'billing')) {
$checkout = Mage::getSingleton('checkout/type_onepage');
$checkout->saveBilling(Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->toArray(),false);
$checkout->saveShipping(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->toArray(),false);
$checkout->saveShippingMethod(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod());
$activestep = Mage::app()->getRequest()->getParam('step');
}
else
if($this->getActiveStep()) {
$activestep = $this->getActiveStep();
}
In javascript
accordion.openSection('opc-<?php /* edit */ echo $activestep; ?>');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With