问题
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