1

I am writing one extension in Magento that need to override Magento customer adapter class namely Mage_Customer_Model_Convert_Adapter_Customer.

But when I rewrite it and the profile it is showing me below error.

Fatal error: Class ' Bs_Crm_Model_Customer ' not found in E:\xampp\htdocs\mag\app\code\core\Mage\Dataflow\Model\Convert\Action\Abstract.php on line 182

Thanks in advance.

<?xml version="1.0"?>
<config>
    <modules>
        <Bs_Crm>
            <version>1.0.0</version>
        </Bs_Crm>
    </modules>
    <global>
        <models>
            <crm>
                <class>Bs_Crm_Model</class>
            </crm>      
            <customer>                
                <rewrite>
                    <convert_adapter_customer>
                        Bs_Crm_Model_Customer
                    </convert_adapter_customer>
                </rewrite>
            </customer>
        </models>
    </global>
</config>

Model File.

class Bs_Crm_Model_Customer extends Mage_Customer_Model_Convert_Adapter_Customer
{
    public function saveRow($importData){
        parent::saveRow($importData);
        $id = $this->getCustomerId();
         die($id);
    }
}
  • Can you please add your config.xml and model file to review? – Yogesh Trivedi Aug 31 '17 at 3:53
  • did you get your answer?? – Jigs Parmar Aug 31 '17 at 4:06
  • Please check i have added the code – Bhavin Aug 31 '17 at 8:48
0

In your config.xml, your model code should look like this.

<models>
    <crm>
        <class>Bs_Crm_Model</class>
        <resourceModel>crm_mysql4</resourceModel>
    </crm>
    <customer>
        <rewrite>
            <convert_adapter_customer>Bs_Crm_Model_Customer_Convert_Adapter_Customer</convert_adapter_customer>
        </rewrite>
    </customer>
</models>

and create a file named Customer.php on path Bs/Crm/Model/Customer/Convert/Adapter/ and add following contents:

<?php 
class Bs_Crm_Model_Customer_Convert_Adapter_Customer extends Mage_Customer_Model_Convert_Adapter_Customer{
/* Your code here */
}
|improve this answer|||||
  • Yes, I have done the same thing in config file but still get error in admin site. – Bhavin Aug 31 '17 at 6:19
  • <global> <models> <crm> <class>Bs_Crm_Model</class> </crm> <customer> <rewrite> <convert_adapter_customer> Bs_Crm_Model_Customer </convert_adapter_customer> </rewrite> </customer> </models> </global> – Bhavin Aug 31 '17 at 6:52

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.