Option 1: Use AvS_FastSimpleImport directly;
http://avstudnitz.github.io/AvS_FastSimpleImport/options.html
Set the option 'Support Nested Arrays for Import' to Yes and use the nested arrays. Example:
$data = array(
array(
'sku' => '1234567',
'_type' => 'simple',
'_attribute_set' => 'Default',
'_product_websites' => array('de', 'en', 'fr'),
'name' => 'Default',
'price' => 0.99,
'description' => 'Default',
'short_description' => 'Default',
'colors' => array('green', 'silver')
'weight' => 0,
'status' => 1,
'visibility' => 4,
'tax_class_id' => 2,
'qty' => 76,
),
);
Option 2:
To transform files to a different format, I personally use https://github.com/ho-nl/Ho_Import, others use https://github.com/AOEmedia/Aoe_Import. Where Ho_Import offers download options etc, Aoe_Import is multi threaded and has better logic for parsing XML.
Meanwhile I have digged some further and it looks like more people have similar problems. Unfortunately there is nowhere a real clue why this kind of problems occur on some imports in the first place.
But there are workarounds. For the sake of completeness here two similar cases with similar workaround suggestions:
Magento products not showing up after import
https://stackoverflow.com/questions/12953584/product-is-not-displaying-in-listing-in-magento-after-import
Based on these threads and some other suggestions I found I now built a little PHP CLI script for my specific case which only adds the status and only when its missing:
require_once $pathToYourMagentoDirectory.'/app/Mage.php';
Mage::app();
$allProducts = Mage::getModel('catalog/product')->getCollection();
$count = 0;
foreach($allProducts as $product) {
$currentStatus = Mage::getResourceModel('catalog/product')->getAttributeRawValue($product->getEntityId(), 'status');
if ($currentStatus != 1 && $currentStatus != 2) {
$product->setData('status', 1)->getResource()->saveAttribute($product, 'status');
$count++;
}
}
echo ('Fixed '.$count.' products by adding a valid status.');
echo ("\n");
In my case a SQL based fix like suggested in the comments above wouldn't have worked as catalog_product_entity_id simply had no entries for the newly imported products and the status attribute which could have been updated.
Still an odd problem and maybe there would be a better way to approach this - i. e. getting the initial import to work properly...
Best Answer
Please try with below code : create custom file in root like ordercreate.php
http://www.blogtreat.com/programmatically-create-new-order-in-magento-2%EF%BB%BF/
I hope its work for you.