gpt4 book ai didi

java - 玛根托 : get customer_id from salesOrderList

转载 作者:行者123 更新时间:2023-12-01 13:07:23 26 4
gpt4 key购买 nike

我尝试使用此 API 获取订单列表: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 的订单列表?

最佳答案

当我使用 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

关于java - 玛根托 : get customer_id from salesOrderList,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23169873/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com