【问题标题】:Magento : get customer_id from salesOrderListMagento:从 salesOrderList 获取 customer_id
【发布时间】:2014-04-19 12:07:39
【问题描述】:

我尝试使用此 API 获取 orderl 列表:salesOrderList (SOAP V2),我使用此代码:

env = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            env.dotNet = false;
            env.xsd = SoapSerializationEnvelope.XSD;
            env.enc = SoapSerializationEnvelope.ENC;
            SoapObject request = new SoapObject(NAMESPACE,
                    "salesOrderList");
            request.addProperty("sessionId", sessionId);
            //request.addProperty("customerId", id.toString());
            env.setOutputSoapObject(request);
            androidHttpTransport = new HttpTransportSE(URL);
            androidHttpTransport.debug = true;
            androidHttpTransport.call("", env);
            result = env.getResponse();
            Log.d("order result", result.toString());

结果:

increment_id=100000001;
                store_id=1; 
                created_at=2013-12-12 07:36:52; 
                updated_at=2013-12-12 07:36:57; 
                tax_amount=0.0000; 
                shipping_amount=0.0000; 
                discount_amount=0.0000; 
                subtotal=246.0000; 
                grand_total=246.0000; 
                total_qty_ordered=2.0000; 
                base_tax_amount=0.0000; 
                base_shipping_amount=0.0000; 
                base_discount_amount=0.0000; 
                base_subtotal=246.0000; 
                base_grand_total=246.0000; 
                billing_address_id=1; 
                billing_firstname=?????; 
                billing_lastname=????; 
                billing_name=????? ????; 
                store_to_base_rate=1.0000; 
                store_to_order_rate=1.0000; 
                base_to_global_rate=1.0000;
                base_to_order_rate=1.0000; 
                weight=0.0000; 
                store_name=Main Website

我有大问题!结果中没有“customer_id”!如何获取带有订单客户 ID 的订单列表?

【问题讨论】:

    标签: java android api magento soap


    【解决方案1】:

    当我像下面这样使用 php 访问销售订单时

    <?php
    $client = new SoapClient('http://localhost/magento/index.php/api/v2_soap/index?wsdl=1');
    
    
    $session = $client->login('testuser','testuser');
    
    $result = $client->salesOrderList($session);
    echo "<pre>";
        print_r($result);
    echo "<pre>";
    ?>
    

    您将获得以下信息,使用此您可以获得客户 ID。

    Array
    (
        [0] => stdClass Object
            (
                [increment_id] => 100000001
                [store_id] => 1
                [created_at] => 2013-11-13 18:39:27
                [updated_at] => 2013-11-13 18:39:31
                [customer_id] => 1
                -----
                -----
                [customer_email] => xyz@example.com
    

    【讨论】:

    • 我将返回的结果添加到我的问题中
    猜你喜欢
    • 1970-01-01
    • 2017-11-22
    • 2020-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-06
    • 2018-08-30
    相关资源
    最近更新 更多