How to automatically import simple grouped and configurable products

Last modified by mageuser on Fri, June 25, 2010 09:31
Source|Old Revisions  

This is an old revision of the document!


This wiki page has been written starting from the great contribution provided in this forum thread by amartinez

1) Create a new advanced profile

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

1.2) use “Productwithconfigurablesandcategories” as Profile Name

1.3) use the following text as Actions XML

<action type="dataflow/convert_adapter_io" method="load">
    <var name="type">file</var>
    <var name="path">var/import</var>
    <var name="filename"><![CDATA[name_of_my_impor_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">1</var>
    <var name="decimal_separator"><![CDATA[.]]></var>
    <var name="adapter">catalog/convert_adapter_productwithconfigurablesandcategories</var>
    <var name="method">parse</var>
</action>

1.4) change the “name_of_my_impor_file.csv” string with the name of your CVS file (eg. products.csv)

1.5) click the 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)

2) Copy the “Productwithconfigurablesandcategories.php” file in the /var/www/magento/app/code/local/Mage/Catalog/Model/Convert/Adapter/ folder (you should create the folder)

2.1) Look for the following line:

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

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

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)

3.1) 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)

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

5) Prepare the CVS 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"



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs