2

I have a custom module(now just overriding the template files to customize the default checkout structure) that overrides the default checkout process. I want to change the default order of checkout process to Order Review,Sign In,Shipping,Payment.

I have tried by editing opcheckout.js file. But I can't see any change in its order. How is it possible to change its order? Please help..

I have tried to override the block file:app/code/core/Mage/Checkout/Block/Onepage/Abstract.php to app/code/local/Company/Custcheckout/Block/Onepage/Abstract.php

<config>
    <modules>
        <Company_Custcheckout>
            <version>0.0.1</version>
        </Company_Custcheckout>
    </modules> 
    <global>
        <blocks>
            <checkout>
                <rewrite>
                    <onepage_abstract>Company_Custcheckout_Block_Onepage_Abstract</onepage_abstract>

                </rewrite>
            </checkout>
        </blocks>
    </global>
    <frontend>
        <routers>
            <checkout>
                <args>
                    <modules>
                        <Company_Custcheckout before="Mage_Checkout">Company_Custcheckout</Company_Custcheckout>
                    </modules>
                </args>
            </checkout>
        </routers>
        <layout>
            <updates>
                <Custcheckout>
                    <file>custcheckout/custcheckout.xml</file>
                </Custcheckout>
            </updates>
        </layout>
    </frontend> 
</config>

I have changed opcheckout.js file (line number:40) as

this.steps = ['login', 'review', 'shipping', 'shipping_method', 'billing', 'payment'];

1 Answer 1

0

You have to override this function _getStepCodes() from app/code/core/Mage/Checkout/Block/Onepage/Abstract.php to your local codepool

protected function _getStepCodes()
{
    return array('login', 'billing', 'shipping', 'shipping_method', 'payment', 'review');
}
8
  • I have tried, but no luck.I have added the code. Could you please check.
    – Vindhuja
    Jul 25, 2017 at 6:35
  • look my update, the function looks like this
    – PЯINCƎ
    Jul 25, 2017 at 8:02
  • I have used the same code in app/code/local/Company/Custcheckout/Block/Onepage/Abstract.php <?php class Company_Custcheckout_Block_Onepage_Abstract extends Mage_Checkout_Block_Onepage_Abstract { /** * Get checkout steps codes * * @return array */ protected function _getStepCodes() { return array('login', 'billing', 'shipping', 'shipping_method', 'payment', 'review'); } } But not changing the order.
    – Vindhuja
    Jul 25, 2017 at 8:33
  • Try to change Custcheckout with Checkout in folder and class
    – PЯINCƎ
    Jul 25, 2017 at 8:38
  • Not working with your code. app/code/core/Mage/Checkout/Block/Onepage/Abstract.php is abstract class. When I googled, found that "cannot rewrite abstract classes".
    – Vindhuja
    Jul 25, 2017 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.