0
I have created a custom tab for Alternative Products and have to import SKU’s through CSV like related_sku in CSV. I am unable to import my products in custom alternative products tab in product back-end. Please guide how I can achieve this import with CSV.
I have tried making additions in import module of core magento to see if new field is imported and associated to product alternate products
3
Answers
To import custom field and its value using csv, in your custom module use following event
‘catalog_product_import_bunch_save_after’
For example, if alternative_product_skus field is added as a custom field in csv(add column with this name in CSV) and its values sku1,sku2,sku3
You can get this values using “catalog_product_import_bunch_save_after” event
Vendor/Module/etc/adminhtml/events.html
Vendor/Module/Observer/CatalogProductImportBunchSaveAfter.php
Try this patch if you already have created a new relation type in your module.
Verified on Magento 2.3.1 version
To get related products to show using a CSV import sheet. You need to add a ‘related sku’s’ column and a ‘related positions’ column in your CSV.
Add the related SKU/SKU’s you want associated with that item or product in the row of the ‘related sku’s’ column. You can also set the position in ‘related position’ column.