我不能给你关于使用Magmi的建议,但是我将为一个名为ApiImport的免费模块提供一个无耻的插件。它基于ImportExport并且免费。
导入都是通过将数据作为数组提供来完成的。导入单一配置产品一样简单:
<?php
require_once 'app/Mage.php';
Mage::init();
$entities = array(
// Configurable product.
array(
'description' => 'Some description',
'_attribute_set' => 'Default',
'short_description' => 'Some short description',
'_product_websites' => 'base',
'status' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED,
'visibility' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
'tax_class_id' => 0,
'is_in_stock' => 1,
'sku' => 'some_configurable',
'_type' => Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE,
'name' => 'Some configurable',
'price' => rand(1, 1000),
'weight' => rand(1, 1000),
// Link the first simple product:
'_super_products_sku' => 'my_red_blue_simple',
'_super_attribute_code' => 'color',
'_super_attribute_option' => 'blue'
),
// Now optionally link some more simple products:
array(
'_super_products_sku' => 'my_red_simple_product',
'_super_attribute_code' => 'color',
'_super_attribute_option' => 'red'
)
);
// Start the import.
Mage::getModel('api_import/import_api')->importEntities(
$entities,
Mage_ImportExport_Model_Export_Entity_Product::getEntityTypeCode()
);
如果您想对编程产生这些实体更多的帮助,你可以看看Test helper in ApiImport。它可以为所有产品类型和客户生成随机产品。
我也建议你阅读Frequently Asked Questions第一询问任何问题:)
祝你好运了。
我能够使用magmi导入,之前我的CSV中的coloumn名称不是按照wiki文档,谢谢 –