我不能給你關於使用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文檔,謝謝 –