【发布时间】:2016-12-09 13:33:16
【问题描述】:
谁能帮我摆脱这条消息 - 一件产品没有标识符或 sku 这是我的代码 -
$proxy = new SoapClient('http://www.testdomain.com/api/soap/?wsdl');
$sessionId = $proxy->login('myapi', 'test@123');
//$quoteId = $proxy->call( $sessionId, 'cart.create', array( 'default' ) );
$arrProducts = array(
array(
"product_id" => 12,
"qty" => 1,
"options" => array(
"267" => 653,
"268" => array('date' => '12/8/2016'),
)
),
array(
"sku" => 20707,
"quantity" => 4,
"store_id" => 1
)
);
try {
$resultCartProductAdd = $proxy->call(
$sessionId,
"cart_product.add",
array(
991,
array($arrProducts)
)
);
} catch (SoapFault $e) {
$message = $e->getMessage();
print_r($message);
}
我已经尝试了此处找到的所有示例 - http://devdocs.magento.com/guides/m1x/api/soap/checkout/cartProduct/cart_product.add.html 但未能成功,任何帮助将不胜感激,谢谢。
【问题讨论】:
-
也许 id 必须在第二个数组中给出。
-
我试过了但是不行
标签: php soap magento-1.9