Thursday , March 23 2017
Home >> All tutorial >> How to bulk import configurable products in Magento

How to bulk import configurable products in Magento

Hi guys,

In this article, we will guide you to import configurable products in Magento.

This is a guide to import configurable products and categories written by Amartinez from Magentocommerce forum, I summarize his tutorials into this post

Before we start, you should download the script files here.

Step 1:

Create a new advanced profile

1.1) (System→Import/Export→Advanced Profiles) → Add New Profile

1.2) You can use “Productimport” as Profile Name

1.3) Insert the following text as Actions XML

action type="dataflow/convert_adapter_io" method="load"
 var name="type"filet/var
var name="path"var/import/var
 var name="filename"![CDATA[name_of_my_import_file.csv]]/var
 var name="format"![CDATA[csv]]/var
/action
 
action type="dataflow/convert_parser_csv" method="parse"
 var name="delimiter"![CDATA[,]]/var
 var name="enclose"![CDATA["]]/var
 var name="fieldnames"true/var
 var name="store"![CDATA[0]]/var
 var name="number_of_records"/var
 var name="decimal_separator"![CDATA[.]]/var
 var name="adapter"catalog/convert_adapter_productimport/var
 var name="method"parse/var
/action

1.4) Change “name_of_my_import_file.csv” string with the name of your CSV file (eg. products.csv)

1.5) Click on Save Profile button and, when the advanced profile list is displayed, take note of the new profile ID (it should be 7 if no profiles were created before)

Step 2

Upload “Productimport.php” file to /var/www/magento/app/code/local/Mage/Catalog/Model/Convert/Adapter/ folder (you should create the folder)

Look for the following line:

$rootId = 2; // our store's root category id

in your copy of Productimport.php and change with the ID of your root category.

Step 3

Copy the “cron_import_products.php” file in the Magento root folder (eg /var/www/magento/) and make it executable (chmod +x cron_import_products.php)

Look for the following line:

$profile_id = 7; // SYSTEM - IMPORT/EXPORT - ADVANCED PROFILES

in your copy of cron_import_products.php and change with the profile ID you have taken note at step 1.5

Step 4

Add a cron job to execute the import script periodically, something like “00 0 * * * root /var/www/magento/cron_import_products.php”

Step 5

Prepare a products CSV file with the following columns:

"sku","websites","store","has_options","type","attribute_set","config_attributes","news_from_date","categories","name","image","small_image","thumbnail","options_container","status","visibility","weight","description","qty","is_in_stock","assort","size","Wholesale","Normal","price","associated"

Make sure, that the simple products are imported first (on top of the CSV file)!

Formats for specific fields

All of the following fields are to be set only for the configurable products in your file.

associated: SKUs of the simple products to associate with the given configurable product, comma-delimited (e.g. “999101149-4,999101149-6,999101149-8”).

config_attributes: Code of the configurable attributes belonging to the attributeset of the products to associate, comma-delimited (e.g. “Color,Size”).

categories: Categories of the given configurable product. Path of each categorie starting from one level above default category, “/” = pathdelimiter, paths comma-delimited, (e.g. “Brand/DELL,Type/Laptop,Type/Hardware”).

image, small_image, thumbnail: Name of the image to be used for this purpose. Image has to be uploaded to “/media/import” before import. Case-sensitive: jpg <> JPG! Please note leading slash! (e.g. “/999101149.jpg”)

gallery: Name of the images to be used as gallery images. Comma-delimited. Images have to be uploaded to “/media/import” before import. Case-sensitive: jpg <> JPG! Please note leading slash! (e.g. “/999101149(1).jpg,/999101149(2).jpg,/999101149(3).jpg”)

Step 6

If you want, prepare a customers CSV file with the following columns:

"password_hash","website","email","group_id","firstname","lastname","billing_prefix","billing_firstname","billing_middlename","billing_lastname","billing_suffix
","billing_street_full","billing_city","billing_region","billing_country","billing_postcode","billing_telephone","billing_company","billing_fax","shipping_prefi
x","shipping_firstname","shipping_middlename","shipping_lastname","shipping_suffix","shipping_street_full","shipping_city","shipping_region","shipping_country",
"shipping_postcode","shipping_telephone","shipping_company","shipping_fax","created_in","is_subscribed","customer_activated"

 

Step 7

When you want to update your Magento store, you need to upload your CSV files to /var/www/magento/var/import/ folder.

Step 8

Your image files must be in /var/www/magento/media/import folder.

Note: If you receive an Undefined property error when running, change the Productimport.php file as suggested by glandix2:

http://www.magentocommerce.com/boards/viewthread/35865/P135/#t143154


Ready to foster your knowledge with MAGENTO 2 BASIC GUIDE

The new Order Success combo with Magento 2 Inventory Management, Magento 2 Order Fulfillment, Magento 2 Dropship, Magento 2 Barcode Management and Magento 2 Purchase Management

magento website development services


About Champ

Leave a Reply

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