如何从magento soap api购买购物车

时间:2015-05-25 06:45:56

标签: api soap soap-client cart magento-1.9

我为magento创建了一个肥皂客户端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();
        }

1 个答案:

答案 0 :(得分:-1)

这是针对.net api v1

String mlogin = mservice.login(“username”,“password”);

var info = mservice.shoppingCartInfo(mlogin,9,null);

这里9是引用ID,mservice是登录验证。