3

What is the right way to remove the shipping method in the checkout page? I have tried to follow some tutorials, but most of them don't seemed to work in 1.7 version.

4

Most suggestions on this page are outdated by this time or don't work. I just tested MageTitan's Skip Shipping extension on Magento 1.7.0.2 and it works fine. The shipping method step is removed and the cheapest shipping method is automatically selected.

  • I tried the module, and can recommend it. One block override, OnepageController override but still works fine. – user487772 Nov 6 '13 at 11:34
  • i.amniels & @Tim the link is not working, can you post the code here. – Baby in Magento Feb 28 '16 at 19:13
2

please follow this link

Method-1

or

Method-2

it may help you

  • I have tried those tutorials.Both of them do not work in 1.7 version.For example,Mage_Checkout_Block_Onepage does not have $stepCodes variable. – blakcaps Aug 17 '13 at 10:49
  • I followed the 2nd tutorial and it worked, but if I remember, I needed to make a change. The sample code wasn't 100% – kevando Aug 19 '13 at 16:44
1

Override following methods:

In app\code\core\Mage\Checkout\Block\Onepage.php:

protected function _getStepCodes()
{
    return array('login', 'billing', 'shipping'/*, 'shipping_method'*/, 'payment', 'review');
}

and in app\code\core\Mage\Checkout\controllers\OnepageController.php:

public function saveShippingAction()
{
    if ($this->_expireAjax()) {
        return;
    }
    if ($this->getRequest()->isPost()) {
        $data = $this->getRequest()->getPost('shipping', array());
        $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
        $result = $this->getOnepage()->saveShipping($data, $customerAddressId);

        if (!isset($result['error'])) {
            $result['goto_section'] = 'payment';
            $result['update_section'] = array(
                'name' => 'payment-method',
                'html' => $this->_getPaymentMethodsHtml()
            );
        }
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
    }
}
  • Hi Darin Kolev and welcome to MageOverflow. Thanks for the answer. But recommending core hacks is a bad idea. You should at least recommend to copy the file to app/code/local/Mage. – Fabian Blechschmidt Oct 1 '14 at 22:13
0

The "best" way to remove a Shipping method is to disable it in the Magento Backend. Go to the System -> Configuration section of the Magento admin, and click the Shipping Information link under the Sales table. Each shipping method listed should have an Enabled option.

Set this to "No", and the shipping method should be disabled.

enter image description here

  • If all shipping methods are disabled, how can we proceed to next step after shipping method in the checkout process – blakcaps Aug 18 '13 at 3:09
  • @blakcaps Ah, it wasn't clear from your question you wanted to disable the shipping step entirely. That, to my knowledge, isn't a feature of Magento out of the box. Most shops I've see that want that behavior set a flat rate shipping that's free, and have it be the only option. – Alan Storm Aug 18 '13 at 3:16
  • Idea is to hide the shipping method in the frontend and set free shipping as the default shipping method. – blakcaps Aug 18 '13 at 3:28
0

Here is a work around which may be a good option for some people. If the other options are not your thing, you can add an id or class to the shipping method in your theme's /template/checkout/onepage/shipping_method/available.phtml page.

Add something like:

id="shipping_method_<?php echo $_rate->getCode() ?>"

To the shipping method in available.phtml

Should look something like:

<input id="shipping_method_<?php echo $_rate->getCode() ?>"  name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>

Then in CSS you can display:none it:

#shipping_method_flat_rate { display:none;}

note: technically the option is still on the page so it would be possible to open chrome and inspect element, un- display:none it and submit the form with that option selected.

  • Would this even work?? – philwinkle Jul 19 '14 at 15:48

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.