【问题标题】:How to get the cart items from magento soap api如何从 magento soap api 获取购物车项目
【发布时间】:2015-05-25 06:45:55
【问题描述】:

我为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();
        }

【问题讨论】:

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


    【解决方案1】:

    这是.net api v1

    String mlogin = mservice.login("用户名", "密码");

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

    这里9是quote id,mservice是登录认证。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多