Link to a specific step in onepage checkout

后端 未结 4 797
自闭症患者
自闭症患者 2020-12-29 15:51

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

4条回答
  •  佛祖请我去吃肉
    2020-12-29 16:30

    checkout/onepage.phtml:

    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-');
    

提交回复
热议问题