Old variant which was here proposed, changing Magento core classes, that is fully wrong decision. You must follow the application model. This method tested on 1.4 versions.
This doesn’t work correctly on v1.5. The reason is that protected function validateOrder() has been deprecated. The function has been replaced by protected function _validate(), which is part of class Mage_Sales_Model_Service_Quote. Someone should update this page to reflect the necessary changes for v1.5. Block, Controller and Configuration steps work correctly... it’s only the Model that needs to be changed. The Model controls whether Magento checks for a valid shipping method or not.
Give our namespace name - “Digg“. So you have a folder in app/code/local/Digg for modules and module “Checkout”.
You must add next files to you module:
- Block Digg/Checkout/Block/Onepage/Shipping/Method.php
- Controller Digg/Checkout/controllers/OnepageController.php
- Model Digg/Checkout/Model/Type/Onepage.php
- Configuration Digg/Checkout/etc/config.xml
To disable Shipping Method for checkout list, you must hide it. Our custom shipping method inherited from coreMage_Checkout_Block_Onepage_Shipping_Method class. Overload method isShow and return false:
Important:Controllers have no autoloading so you must include it manualy. Overwrite the function saveShippingAction()and saveBillingAction() to skip shipping method to payment with the following code:
The simplest way to ask magento to ignore shipping info is to change validation rule. Te following code overwritingvalidateOrder() method. I just removed part of original code that validate non-virtual products
Last step is configurate our module. The main idea is to ask Magento first searching action methods in our Digg module and if it didn’t found use core.