Aitem
Aitem

Reputation: 393

Hide custom shipping method from checkout form in Magento

I created custom shipping method for magento. And this method needed only for orders created programmatically from others modules.

Question: How i can to hide this method from checkout form without disabling this method in store settings?

Upvotes: 0

Views: 648

Answers (1)

Latheesan
Latheesan

Reputation: 24116

I assume the other modules will use your shipping method from admin context; so you could do something like this:

update your collectRates method like this:

public function collectRates(Mage_Shipping_Model_Rate_Request $request)
{
    if (!Mage::app()->getStore()->isAdmin())) {
        return false;
    }

    // rest of your code

This way, you should be able to have the shipping method active but only usable in admin context.

Upvotes: 1

Related Questions