1

I have some configurable products that needs no shipping so I want the checkout to hide the shipping information (second step) and shipping method (third step): when the customer lands on checkout page, he can set his billing information and when he clicks on the continue button he needs to go straight to the payment step.

I've managed to hide the shipping method step by using the observer as explained in this thread and this part works as expected: the customer lands on the checkout page, fills in billing information, clicks on continue and (because "ship to this address" is flagged) he goes straight to the payment section, leaving out the shipping method.

Since I don't need the shipping method step, I've hidden it by rewriting the onepage_shipping_method:

  • I've added the rewrite in my config.xml
        <blocks>
            <checkout>
                <rewrite>
                     <onepage_shipping_method>Vendor_Module_Block_Onepage_Shipping_Method</onepage_shipping_method>
                </rewrite>
            </checkout>
        </blocks>
  • I've set the step to show = false in the block:
class Vendor_Module_Block_Onepage_Shipping_Method extends Mage_Checkout_Block_Onepage_Shipping_Method {
    public function isShow() {return false;}
}

This works: now the customer not only skips the shipping method step, but this step is also hidden so the customer doesn't see. That's perferct.

Now I need to hide the second step (shipping information). In order to do this I need to first hide the the radio buttons (ship to this/different address) in the billing step, then I need to hide the second step (the shipping information step).

To hide the radio buttons I simply rewrote the billing block, setting the canShip method to false:

  • config.xml
<blocks>
            <checkout>
                <rewrite>
                    <onepage_billing>Vendor_Module_Block_Onepage_Billing</onepage_billing>              <onepage_shipping_method>Vendor_Module_Block_Onepage_Shipping_Method</onepage_shipping_method>
                </rewrite>
            </checkout>
        </blocks>
  • my block
class Vendor_Module_Block_Onepage_Billing extends Mage_Checkout_Block_Onepage_Billing {
    public function canShip() {return false;}
}

This works: when I land on the checkout page, I see the billing step but no radio button are shown and when I click on continue I go straight to the payment step.

However, the shipping information step is still visible. If I try and hide it the same way I did for the shipping method step, the continue button stops working. What I mean is:

  • I add the block rewrite in my config.xml
<blocks>
            <checkout>
                <rewrite>
                   <onepage_billing>Vendor_Module_Block_Onepage_Billing</onepage_billing>
                    <onepage_shipping>Vendor_Module_Block_Onepage_Shipping</onepage_shipping>   
                  <onepage_shipping_method>Vendor_Module_Block_Onepage_Shipping_Method</onepage_shipping_method>
                </rewrite>
            </checkout>
        </blocks>
  • I create the block with the isShow method set to false:
class Vendor_Module_Block_Onepage_Shipping extends Mage_Checkout_Block_Onepage_Shipping {
    public function isShow() {return false;}
}

This doesn't work: when I land to the checkout page, fill in the billing information and click on continue, the continue button does nothing: for a single moment the loading icon appears but then nothing happens, the checkout doesn't go to the payment section

So my question is: how can I hide the shipping information step from checkout?

0

Shipping shows up in the checkout if the quote is not "virtual". This is checked by the method Mage_Sales_Model_Quote::isVirtual. Maybe you could modify that method instead so you would only have one point to modify and not to have rewrite some blocks. Have a look at this answer for details on how one could modify the method.

Previous answer before clarification of OP:

Maybe I understood something wrong, but as I'm aware shipping is only available for simple products. If you use virtual products on your configurable products then no shipping would appear in checkout simply because a order consisting only of virtual products is not shipable?

We are working with a heavily customized checkout so I'm not sure if that is also 100% correct for the standard checkout. But it would be worth a try.

| improve this answer | |
  • you are right when you say that virtual products don't have shipping. My problem is that the website has been created with simple products and I cannot redo the whole catalog from scratch using virtual product so I have to find a way to have those simple products behave like they were virtual products – Lounik Dec 13 '19 at 10:12
  • I have suggested another solution possibility and updated the answer. – nebulon42 Dec 17 '19 at 20:24

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.