简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM