“101:产品不存在”(Magento API)product.update

我看到了文档,但是我仍然没有在代码中发现错误。

我试图从excel文件添加产品到Magento系统,然后在每个商店视图 (多语言商店) 上更新它

为此,我已经完成了下面的PHP脚本。 在这个代码中,我只读了一个Excel行(只是为了告诉你它是如何工作的),然后我将它添加到Magento(实际上是工作 ),然后我试图更新的东西(给出错误 )。 请注意$ col [9]是保存SKU的variables。

注意:我正在使用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); 

我将不胜感激任何帮助,你们可以给!

我刚刚发现了这个问题的解决方法,但是这确实没有任何意义。

所以,当我们通过电话发送SKU时,我们需要发送额外的空间。 这意味着$更新需要是这样的:

  $soap->call($session_id, 'catalog_product.update', array($col[9].' ', $updatearray, 'fr'));