How to Import Products from Ebay to Magento 2

How to Import Products from Ebay to Magento 2

What to do if you need to import products from Ebay to Magento 2? In the following article I am going to explain how to perform this task.

Ebay export file is represented by *.xlsx file with 62 columns. To decrease development time we suggest couple of decisions:

  • At the first stage: manually convert this file into *.csv format, then create a new table in database and transfer all the data from the document into it.
  • At the 2nd stage: reorganize the table to import file for Magento 2 according to the required structure in *.csv.

At first we should determine the following names:

  • Table name
  • Source file name
  • New file name (new file that we will generate)
  • Source folder name
  • New files folder name (where new files that generated by our script will be stored)
  • Images folder name

In the third block we enter data for connecting with database, in which we are going to transfer all the data from the source file. We change table name, old file name and new file name for each product.

Further we connect up two libraries.

The first- default Symphony library for conversion product name into url-key.

The second- small library, that includes only one function: downloadlmg, which receives url images and name of the folder where we save product images:

At first let’s create a table and transfer all data from the source file into it.

Let’s define product attributes array, that we will import to Magento 2.

And for the record, all the attributes and their values that we import, must be in Magento 2 already.

Products that we have imported could be divided into 3 groups: configurable, simple that are included in configurable, and independent simple products. Each of these types we should add separately. I won’t give you as example entire code, because of its size, but I’ll consider the basic parts (entire code is available here: https://github.com/morfij/importer-ebay-magento2).

We sort out simple products, that are included in configurable, by the having of  “parent_sku”:

Simple:

Configurable:

«Variation_type» column shows us what attributes describe the configurable product features and it has “attribute1- attribute2” format. Let’s configure attribute set that we need:

After all the data was collected in $importArray, we write it in our file.



1 comment

Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *