Page tree
Skip to end of metadata
Go to start of metadata



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.

Magento 1.5 note


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:

  1. Block Digg/Checkout/Block/Onepage/Shipping/Method.php
  2. Controller Digg/Checkout/controllers/OnepageController.php
  3. Model Digg/Checkout/Model/Type/Onepage.php
  4. Configuration Digg/Checkout/etc/config.xml

1. Block (Method.php)


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:

 Expand source

 Controller (OnepageController.php)


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:

 Expand source

 Model (Onepage.php)


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

 Expand source

 Configuration (config.xml)


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.

 Expand source
Don’t forget to register your module in app/etc/modules/Digg_All.xml:


 Expand source




  • No labels