Magento 1.9 - SOAP V1 - 一项产品没有标识符或 sku
Magento 1.9 - SOAP V1 - One item of products do not have identifier or sku
任何人都可以帮我摆脱这条消息 - 一件产品没有标识符或 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 但未能成功,非常感谢任何帮助,谢谢。
最后我把它解决为 -
$proxy = new SoapClient('http://www.testdomain.com/api/soap/?wsdl');
$sessionId = $proxy->login('apitest', 'test@123');
//$quoteId = $proxy->call( $sessionId, 'cart.create', array( 'default' ) );
$arrProducts = array(
array(
"product_id" => 12,
"quantity" => 1,
"options" => array(
"267" => 653,
"268" => array('date' => '12/8/2016'),
),
"sku" => 20707,
"quantity" => 4,
"store_id" => 1
)
);
try {
$resultCartProductAdd = $proxy->call(
$sessionId,
"cart_product.add",
array(
985,
$arrProducts
)
);
print_r($resultCartProductAdd);
} catch (SoapFault $e) {
$message = $e->getMessage();
print_r($message);
}
我更新了 $arrProducts 数组,它解决了我的问题。希望这对其他人有帮助,谢谢。
任何人都可以帮我摆脱这条消息 - 一件产品没有标识符或 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 但未能成功,非常感谢任何帮助,谢谢。
最后我把它解决为 -
$proxy = new SoapClient('http://www.testdomain.com/api/soap/?wsdl');
$sessionId = $proxy->login('apitest', 'test@123');
//$quoteId = $proxy->call( $sessionId, 'cart.create', array( 'default' ) );
$arrProducts = array(
array(
"product_id" => 12,
"quantity" => 1,
"options" => array(
"267" => 653,
"268" => array('date' => '12/8/2016'),
),
"sku" => 20707,
"quantity" => 4,
"store_id" => 1
)
);
try {
$resultCartProductAdd = $proxy->call(
$sessionId,
"cart_product.add",
array(
985,
$arrProducts
)
);
print_r($resultCartProductAdd);
} catch (SoapFault $e) {
$message = $e->getMessage();
print_r($message);
}
我更新了 $arrProducts 数组,它解决了我的问题。希望这对其他人有帮助,谢谢。