Magento

How to Add Sample File For Custom Entity Import Functionality in Magento 2

    Blog       This Blog shows you how to create your own new entity type for import data extending the Magento/ImportExport/Model/Import/Entity/AbstractEntity class to import data into the custom module’s table. When you create your own module you need to attached Download sample file to easily manage Import data. Current import entities can be found in System > Import:    
  • Create import.xml file under the etc/import.xml
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd">
  • Now you have to create di.xml in etc folder, etc/di.xml
http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">



Publicdesign_DeliverydateImport



 

  • Now create a function in Model file, a path for module based on the import.xml file model attribute, Publicdesign\DeliverydateImport\Model\Import\Deliverydate.php
    Publicdesign/DeliverydateImport\Files\Sample\publicdesign_deliverydateimport.csv file, CSV file contains the Sample data you have to import.
  • In admin go to System -> Data Transfer -> Import
Select the new entity you have created and click download sample file; file is downloaded with sample data.     Data Transfer Import     Now you click on Download Sample file with your new entity option selected, the file will download with your sample data.
This blog is written by Urvi Sheth
Magento Developer TridhyaTech  
Magento

Magento

How to add Custom Validation to checkout fields in Magento 2?

User experience plays an important role throughout the buying journey in online shopping. The store must be designed in a way that it responds.

Transform Your Business With Digital Enterprise Solutions

Contact us

Our Offices

country-flag
AHMEDABAD, INDIA

401, One World West, Nr. Ambli T-Junction 200, S P Ring Road, Bopal, Ahmedabad, Gujarat 380058

country-flag
UK

Kemp House 160 City Road, London, United Kingdom EC1V 2NX

country-flag
GERMANY

Nürnberger Str. 46 90579 Langenzenn Deutschland

country-flag
AUSTRALIA

Level 36 Riparian Plaza, 71 Eagle Street, Brisbane, QLD 4000

country-flag
USA

4411 Suwanee Dam road, Bld. 300 Ste. 350 Suwanee GA, 30024