I want to export my custom entity from the admin like products, customers, etc… I have already created the code for the import for my custom entity and it is working fine. But now I want to add the same entity for the export my data. Please see attached image that how I want the functionality.
There is a simple database table with three fields. The table name is 'manufacturer_manufacturer' and fields name are following.
There is no any primary key.
- manufacturer
- model
- product_ids
So I want just export above data from my table only.
I want to add the option in dropdown like 'manufacturer'.If admin selects that value and export then all the data should be exported in the CSV format.
Best Answer
This is possible by following the below steps;
Include export.xml in your module etc directory with a content similar to the below;
Ensure your export model class extend \Magento\ImportExport\Model\Export\AbstractEntity class, then override the abstract methods to add your concrete implementations. The export model class will be similar to the below;
You can get more information on how to implement these abstract methods in \Magento\CustomerImportExport\Model\Export\Customer class.
I hope this helps.