我已经为magento创建了一个soap客户端Api,我的要求是获得当前用户购物车中添加的项目。我怎么才能得到这个?
$host = "localhost/magformers_theme/index.php"; //our online shop url
$client = new SoapClient("http://".$host."/api/soap/?wsdl"); //soap handle
$apiuser= "user"; //webservice user login
$apikey = "magentouser"; //webservice user pass
$action = "sales_order.list"; //an action to call later (loading Sales Order List)
try {
$sess_id= $client->login($apiuser, $apikey); //we do login
//print_r($client->call($sess_id, $action));
$result = $client->call($sess_id, 'catalog_product.list');
var_dump ($result);
}
catch (Exception $e) { //while an error has occured
echo "==> Error: ".$e->getMessage(); //we print this
exit();
}
这是针对。net api v1的
String mlogin = mservice。登录("用户名","密码");
var info = mservice。shoppingCartInfo(mlogin, 9, null);
这里9是引用id, mservice是登录认证