Magento event observer for bulk import for products

不想你离开。 提交于 2019-12-07 21:50:42

问题


Is there any event for "bulk import of products/customers"?

I intend to make a module for my vendors to upload their product information in xml/csv through the backend. When they upload, I need to update my Solr records.

Thanx


回答1:


You can override the Mage_Catalog_Model_Convert_Adapter_Product::saveRow() as:
1> in config.xml

<global>
    <models>
...
        <catalog>
            <rewrite>
                <!-- Override Mage_Catalog_Model_Convert_Adapter_Product -->
                <convert_adapter_product>MagePsycho_Productimport_Model_Convert_Adapter_Product</convert_adapter_product>
            </rewrite>
        </catalog>
...
    </models>
</global>

2> create class file as

class MagePsycho_Productimport_Model_Convert_Adapter_Product extends Mage_Catalog_Model_Convert_Adapter_Product
{    
    public function saveRow(array $importData)
    {
      parent::saveRow($importData);
      //do your extra stuffs here..
    }
}

Note: This is just an idea, you need to develop full working module by yourself.

Thanks
Regards
MagePsycho



来源:https://stackoverflow.com/questions/7310108/magento-event-observer-for-bulk-import-for-products

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!