0
我看到了documentation,但我仍未在代碼中發現錯誤。「101:產品不存在」。 (Magento API)product.update
我想添加一個產品從Excel文件Magento的系統,然後更新它的每個店鋪查看(多語言店)。
對於這一點,我已經做了以下PHP腳本。在此代碼,我讀只有一個Excel的行(只是向你展示它是如何工作的),然後我正在將它添加到Magento的(實際上這是工作),然後我試圖更新的東西(給錯誤 )。請注意$ col [9]是保存SKU的變量。
注:我使用SOAP,而不是V2。
$rowdata=$sheet->rangeToArray('A' . $row.':'.$maxcol . $row, NULL, TRUE, FALSE);
$col=$rowdata[0];
//$soap is the client. $session_id is the logged in SOAP session.
$attributeSets = $soap->call($session_id, 'product_attribute_set.list');
$attributeSet = current($attributeSets);
$result = $soap->call($session_id, 'catalog_product.create', array('simple', $attributeSet['set_id'], $col[9], array(
'categories' => array(2),
'websites' => array(1),
'name' => $col[1],
'description' => $col[10],
'short_description' => $col[13],
'weight' => '10',
'status' => '1',
'url_key' => 'product-url-key',
'url_path' => 'product-url-path',
'visibility' => '4',
'price' => $col[20],
'tax_class_id' => 1,
'meta_title' => 'Product meta title',
'meta_keyword' => 'Product meta keyword',
'meta_description' => 'Product meta description'
)));
var_dump ($result);
$updatearray= array(
'name' => $col[2],
'description' => $col[11],
'short_description' => $col[14]
);
$update = $soap->call($session_id, 'catalog_product.update', array($col[9], $updatearray, 'fr'));
var_dump ($update);
我將不勝感激任何幫助,你們可以給!