I am struggling to find a way to combine the Shipping Address and Shipping method into a single step on the default Magento Onepage Checkout. I know that there are many 3rd-party OneStepCheckout extensions (some of which I have used in the past), but I prefer the flow of the onepage checkout…I would just like to optimise it.
Ideally, I would like to prompt for Shipping Address and Shipping Method in the first step, followed by prompting the customer for their billing address (if different) and payment information together in a single step as well. We only have 2 shipping methods which are not determined by shipping address, so there will be no need to make any ajax calls to update the available shipping methods.
I know that checkout is difficult to customise in this regard, but I would sincerely appreciate any pointers and/or advice please.
Best Answer
Your Solution:
Step: 1
Override Controller:
\app\code\local\Htech\Checkout\controllers\OnepageController.php
Step: 2
Create Config file:
\app\code\local\Htech\Checkout\etc\config.xml
Block:
\app\code\local\Mage\Checkout\Block\Onepage\Abstract.php
Copy Abstract.php from core and change_getStepCodes()
method to followingStep: 3
Change Layout:
\app\design\frontend\rwd\default\layout\checkout.xml
Remove/Comment All Block with
shipping.phtml
file formcheckout_onepage_index
andcheckout_onepage_progress
i.e.
<block type="checkout/onepage_progress" name="shipping.progress" template="checkout/onepage/progress/shipping.phtml"></block>
<block type="checkout/onepage_shipping" name="checkout.onepage.shipping" as="shipping" template="checkout/onepage/shipping.phtml" />
<block type="checkout/onepage_progress" name="shipping.progress" template="checkout/onepage/progress/shipping.phtml"></block>
Step: 4
Template:
\app\design\frontend\rwd\default\template\checkout\onepage.phtml
Add This code After
<div class="step-title">....</div>
<div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;"> <?php if($_stepId=='shipping_method'){ ?> <?php echo $this->getLayout()->createBlock('checkout/onepage_shipping')->setTemplate('checkout/onepage/shipping.phtml')->toHtml(); ?> <?php } ?> <?php echo $this->getChildHtml($_stepId) ?> </div>
If Some one have short mehtod for this then share.
Output: