0

I'm new to magento, I'm rewrite the Mage_Shipping_Model_Carrier_Abstract class. But it's not calling?

my code is:

config.xml

....
 <models>
<shipping>
                <rewrite>
                    <carrier_abstract>Easylife_ThirdParty_Model_Carrier_Abstract</carrier_abstract>
                </rewrite>
            </shipping>
 </models>
..

//abstract.php

<?php

class Easylife_ThirdParty_Model_Carrier_Abstract extends Mage_Shipping_Model_Carrier_Abstract
{
    public function collectRates(Mage_Shipping_Model_Rate_Request $request){
        Mage::log('Collect Rates');
        return parent::collectRates($request);
    }

    public function getMethodPrice($cost, $method = '')
    {
        //get the session
        Mage::log('get Method Price');
        return $method == $this->getConfigData($this->_freeMethod)
        && $this->getConfigFlag('free_shipping_enable')
        && $this->getConfigData('free_shipping_subtotal') <= $this->_rawRequest->getBaseSubtotalInclTax()
            ? '0.00'
            : $this->getFinalPriceWithHandlingFee($cost);
    }

}

It's not calling. Is this Correct/Not? If not how can I rewrite?

Thanks.

2

Manoj ,you can

not overwrite any abstract class in php.

If you want to modify Mage_Shipping_Model_Carrier_Abstract class then copy Mage>Shipping>Model>Carrier>Abstract.php to app>code>local>Mage>Shipping>Model>Carrier>Abstract.php Or

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.