$colors = array("Red", "Green", "Blue");
foreach ($colors as $color) {
$sku = "simple_color_".$color;
$simple_product = array(
"store"=>"default", "sku"=>$sku, "name"=>$sku, "description"=>$sku, "price"=>"5",
"type"=>"simple", "product_type"=>"simple",
"visibility"=>"4",
// Stock
"is_in_stock"=>"1", "manage_stock"=>"1", "use_config_manage_stock"=>"1",
"qty"=>"10", "out_of_stock_qty"=>"0",
// Cart
"is_qty_decimal"=>"1", "max_cart_qty"=>"10",
// Categories
"categories"=>"Damen::1::0::1/Mode::1::1::1;;EBAY::0::0::0/Damen::0::0::0/Mode::0::0::0",
);
$simple_product["color"] = $color;
$simple_product["additional_attributes"] = "color=".$color;
$configurable_variations[] = "sku=".$sku.","."color=".$color;
$simples_skus[] = $sku;
$dp->ingest($simple_product);
}
// category name::[is_active]::[is_anchor]::[include_in_menu]
$config_product = array(
"store"=>"default", "sku"=>"config_color", "name"=>"config_color", "description"=>"config_color", "price"=>"10",
"type"=>"configurable", "product_type"=>"configurable", "visibility"=>"4", "is_in_stock"=>"1",
"categories"=>"Damen::1::0::1/Mode::1::1::1",
);
$config_product["configurable_attributes"] = "color";
$config_product["configurable_variations"] = implode("|", $configurable_variations);
$config_product["simples_skus"] = implode(",", $simples_skus);
$dp->ingest($config_product);