Magmi导入可配置产品

时间:2013-04-23 09:59:27

标签: magento magento-1.7 magmi

我尝试使用magmi导入产品。我可以导入简单的产品。但无法导入可配置产品。我尝试查找示例csv文件以导入可配置产品。但我找不到合适的人。我知道我的csv文件有问题。任何人都可以帮我解决我的问题吗?这是我的csv文件。

sku,store,attributeset,type,category,root_category,product_websites,activation_information,color,computer_manufacturers,contrast_ratio,cost,country_of_manufacture,country_orgin,cpu_speed,created_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,description,dimension,enable_googlecheckout,finish,gallery,gender,gift_message_available,harddrive_speed,hardrive,has_options,image,image_label,in_depth,manufacturer,max_resolution,media_gallery,megapixels,memory,meta_description,meta_keyword,meta_title,minimal_price,model,msrp,msrp_display_actual_price_type,msrp_enabled,name,news_from_date,news_to_date,options_container,page_layout,price,processor,ram_size,required_options,response_time,room,screensize,shape,shirt_size,shoe_size,shoe_type,short_description,small_image,small_image_label,special_from_date,special_price,special_to_date,status,tax_class_id,thumbnail,thumbnail_label,updated_at,url_key,url_path,visibility,weight,qty,min_qty,use_config_min_qty,is_qty_decimal,backorders,use_config_backorders,min_sale_qty,use_config_min_sale_qty,max_sale_qty,use_config_max_sale_qty,is_in_stock,notify_stock_qty,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,stock_status_changed_auto,use_config_qty_increments,qty_increments,use_config_enable_qty_inc,enable_qty_increments,is_decimal_divided,links_related_sku,links_related_position,links_crosssell_sku,links_crosssell_position,links_upsell_sku,links_upsell_position,associated_sku,associated_default_qty,associated_position,tier_price_website,tier_price_customer_group,tier_price_qty,tier_price_price,group_price_website,group_price_customer_group,group_price_price,media_attribute_id,media_image,media_lable,media_position,media_is_disabled,custom_option_store,custom_option_type,custom_option_title,custom_option_is_required,custom_option_price,custom_option_sku,custom_option_max_characters,custom_option_sort_order,custom_option_row_title,custom_option_row_price,custom_option_row_sku,custom_option_row_sort,super_products_sku,super_attribute_code,super_attribute_option,super_attribute_price_corr,simples_skus,configurable_attributes
999-Black,,Default,simple,,,base,,Black,,,,,,,4/23/2013 9:29,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Black,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:29,my-is-test-black,my-is-test-black.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999-Blue,,Default,simple,,,base,,Blue,,,,,,,4/23/2013 9:30,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Blue,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:30,my-is-test-blue,my-is-test-blue.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999-Brown,,Default,simple,,,base,,Brown,,,,,,,4/23/2013 9:30,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Brown,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:30,my-is-test-brown,my-is-test-brown.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999-Green,,Default,simple,,,base,,Green,,,,,,,4/23/2013 9:30,,,,,test,,1,,,,,,,0,,,,,,,,,,,,,,,Use config,Use config,My IS test-Green,,,Block after Info Column,,122,,,0,,,,,,,,tewst,,,,,,1,0,,,4/23/2013 9:30,my-is-test-green,my-is-test-green.html,1,100,100,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
999,,Default,configurable,Furniture/Living Room,Root Catalog,base,,,,,,,,,4/23/2013 9:29,,,,,test,,1,,,,,,,1,no_selection,,,,,,,,,,,,,,Use config,Use config,My IS test,,,Block after Info Column,,122,,,1,,,,,,,,tewst,no_selection,,,,,1,0,no_selection,,4/23/2013 9:30,my-is-test,my-is-test.html,4,,0,0,1,0,0,1,1,1,0,1,1,,1,0,1,0,1,0,1,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"999-Black,999-Blue,999-Brown,999-Green",color,"Black,Blue,Brown,Green",,"999-Black,999-Blue,999-Brown,999-Green",color

2 个答案:

答案 0 :(得分:6)

确保您启用了Configurable Item processor插件。它列在Magmi的Itemprocessors部分。

还要确保Configurable Item processor插件的设置如下:

Perform simples/configurable link设置为Yes

auto match simples skus before configurable设置为No(因为您在simples_skus列中指定了匹配项。

答案 1 :(得分:0)

在我的情况下,解决方案是编辑文件magmi / plugins / base / itemprocessors / configurables / magmi_configurableprocessor.php更改行:

        //if no entry found, create one
        if($psaid==NULL)
        {
            $sql="INSERT INTO `$cpsa` (`product_id`,`attribute_id`,`position`) VALUES (?,?,?)";
            //inserting new options
            $psaid=$this->insert($sql,array($pid,$attrid,$idx));    
        }

代表

//if no entry found, create one
        if($psaid==NULL)
        {
            $sql="INSERT INTO `$cpsa` (`product_id`,`attribute_id`,`position`) VALUES (:a, :b, :c)";
            $data = array(
                'a' => $pid,
                'b' => $attrid,
                'c' =>$idx,
            );
            //inserting new options
            $psaid=$this->insert($sql,$data);
        }