Eugene Eugene - 1 year ago 71
C# Question

WooCommerce Adress error (C# UWP)

I try to receive data from WC like this

RestAPI rest = new RestAPI("", "ck_9d64c027d2c5f81b8bed3342eeccc6d337be813d", "cs_60697b1e6cbdeb8d62d19e0765e339f8e3334754");

WCObject wc = new WCObject(rest);
//Get all products
var orders = await wc.GetOrders();

foreach (var order in orders) {
Debug.WriteLine($"Currency: {order.currency},Date:{order.date_created},Adress: {order.shipping}, Total Cost: {}");

In this code all okay.

But I have this in output
Adress: WooCommerceNET.WooCommerce.ShippingAddress

Why I don't see adress?

Answer Source

I'm assuming you need to access each individual line of the address rather than it being nicely formatted into a single line. Without going through the source of the plugin, something similar to order.shipping.streetname, may be the solution.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download