Import products magento script

This tutorial explains how to import products magento using script.Here products are importing from opencart to magento using the script.I have exported the following CSV files from the opencart backend.

This script import all the categories, attribute and the products to magento. Its also create the simple and configurable products and assign that to the new categories. Here I am also importing the related products as well.

The excelsheet exported from the opencart contains main four CSV:

  1. Products.csv – Download Sample CSV
  2. Options.csv – Download Sample CSV
  3. Catgeories.csv – Download Sample CSV
  4. Discount.csv (for tier prices) – Download Sample CSV

Step by step explanation

  1. Import attribute options
  2. Import categories magento
  3. Read CSV data
  4. Import simple products
  5. Import Configurable products
  6. Import product Images
  7. Add related products
  8. Import tier prices

Import attribute options

As the first step I have created the attribute (Color based on my example) in the magento backend .Then I imported the options programmatically . Please click here to refer the tutorial which explains how to import the options from the CSV.

Import categories magento

As the next step I have created the categories. Please click here to refer the tutorial which explains how to read the data from the CSV and import the categories.

Read product data

Click here to find tutorial which explains how to read product data from products.csv file.

The function getProducts() read that data from the products.csv and saved that in an array as shown here.

Import magento products

This is the main function that import the products.In this function based on the options it decides whether to create simple or configurable products.Click here for detailed explanation or please check the related links below.

Import product images

As the next step I am explaining how to set product images to the magento products.
Please click here for importing the product images.

Import tier prices

Please click here for tutorial

Output

import-products-magento-output

Share this Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

*