cancel
Showing results for 
Search instead for 
Did you mean: 

Magento2.3 Custom Import error

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Magento2.3 Custom Import error

I'm trying to write a custom importer for products, as they need to take a CSV in a particular format from our customers supplier.

 

When it's finished it'll remove and then readd all product variations for a single product.

 

However I seam to be running into a bit of a wall getting Magento to accept it an run any code.

 

My code is based on this tutorial: http://www.blogtreat.com/how-to-import-csv-file-to-custom-module-table-in-magento-2/

 

The error is "The input entity code is not equal to entity adapter code."

 

Import.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_ImportExport:etc/import.xsd">
<entity name="catalog_product" label="Route1Import"
model="KyeEtherton\RouteImport\Model\Import\RouteImport"
behaviorModel="Magento\ImportExport\Model\Source\Import\Behavior\Basic" />
</config>


And RouteImport.php

/**
* Entity type code getter.
*
* @return string
*/
public function getEntityTypeCode() {
$this->logger->info("Report Entity Type Code: ");
return 'catalog_product';
}

Does anyone know what it is that I'm missing?

5 REPLIES 5

Re: Magento2.3 Custom Import error

Hi kye,

I think your di is wrong it should be:

<preference for="Magento\CatalogImportExport\Model\Import\Product" type="Vendor\Module\Model\Import\DataflowProfiles" />

Hope it helps!

if issue solved,Click Kudos & Accept as Solution
Thanks

Re: Magento2.3 Custom Import error

Hello Arifcs,

 

What DI? Where would I put that code?

Re: Magento2.3 Custom Import error

In your extension KyeEtherton_RouteImport, put the di.xml in etc folder.

 

Thanks

Re: Magento2.3 Custom Import error

That's likely to be the issue, there wasn't one of them in the tutorial that I linked to.  It's possible that something was missed in that as it's only about importing and not about writing modules.

 

I don't have a di.xml file, as there wasn't one in the tutorial, or in the Magento2.3 guide to writing modules. So I have no idea what they are. Sorry.

 

Also to note, this is a separate importer, I'm not trying to replace the current one.

Re: Magento2.3 Custom Import error

Still not managed to have any luck on this.

 

If anyone can help I'm happy to pay a fee to get this fixed.

 

My telegram is etherkye.