I want to insert the entity_id of my modified products while csv import into my custom table.
My custom table "tgs_queue" columns : (id, product_id) //id-primary key
In CatalogImportExport saveProductEntity() i tried something like this:
public function saveProductEntity(array $entityRowsIn, array $entityRowsUp)
{
//custom code
if (!$tableName) {
$tableName = $this->_resourceFactory->create()->getTable('tgs_queue');
}
if ($entityRowsUp) {
$this->_connection->insertOnDuplicate($entityTable,$entityRowsUp, ['updated_at']);
//custom code
$this->_connection->insertOnDuplicate($tableName, $entityRowsUp);
}
I get the error for updated_at' as
General system exception happened
Additional data: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list', query was: INSERT INTO `tgs_queue` (`updated_at`,`entity_id`) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?) ON DUPLICATE KEY UPDATE `updated_at` = VALUES(`updated_at`), `entity_id` = VALUES(`entity_id`)
Whats the proper way of Inserting my data to custom table during import csv?
asked Aug 3, 2016 at 7:11
Sushivam
2,6394 gold badges37 silver badges88 bronze badges
default
catalog_product_import_finish_beforeafter the product import is completed,vendor/magento/module-catalog-import-export/Model/Import/Product.php:890. You can use an event observer to add logic after the import process