如何通过在安卓应用程序购物车中以访客身份登录来生成订单 ID



我正在开发一个购物车应用程序,作为注册客户,我可以生成订单ID,但我不知道如何使用来宾客户。我使用以下代码设置来宾客户。

SoapObject res = new SoapObject(SOAP_NAMESPACE, SHOPPING_CART_CUSTOMER_SET);
res.addProperty("mode", "guest");
res.addProperty("customer_id",62);
res.addProperty("email", "muthu1984mca@gmail.com");
res.addProperty("firstname", "Muthamizhan");
res.addProperty("lastname", "Chelladurai");
res.addProperty("confirmation", true);
res.addProperty("website_id",1);
res.addProperty("store_id",1);
res.addProperty("group_id",1);
request = new SoapObject(SOAP_NAMESPACE, SHOPPING_CART_CUSTOMER_SET);
request.addProperty("sessionId", sessionId);
request.addProperty("quoteId", shoppingCartID);
request.addProperty("customer",res);
// request.addProperty("storeId","1");
// request.addProperty("paymentData",values);
envelope.setOutputSoapObject(request);
transport.debug = true;
transport.call(SOAP_NAMESPACE + SOAP_PREFIX + SHOPPING_CART_CUSTOMER_SET,  envelope);
// getting the response which is the customerId
Log.d("Setting Customer", "request:" + transport.requestDump);
Log.d("Setting Customer", "response:" + transport.responseDump);

对于来宾客户,不需要此方法"shoppingCartCustomerSet"。跳过此步骤,您可以直接添加帐单和送货地址,送货方式,付款方式,然后生成订单。它会自动将客户设置为来宾。

最新更新