API documentation?
-
Hi – I’m trying to get this plugin to work well with a printing plugin that I’m using.
$order_data = $order->get_data(); print_r($order_data);
The issue I’m having is – I can’t seem to get the plugin to properly retrieve the shipping data. The above code outputs all of the data for the order (which is expected) but says the
shipping_lines
(which seems to be the data I need) data in the array is protected.I tried an api request through postman just to see what the json is like, and this is the output for “shipping_lines”.
"shipping_lines": [ { "id": 142, "method_title": "Local Pickup", "method_id": "local_pickup_plus", "instance_id": "0", "total": "0.00", "total_tax": "0.00", "taxes": [], "meta_data": [ { "id": 1109, "key": "_pickup_appointment_start", "value": "1594314000" }, { "id": 1110, "key": "_pickup_appointment_end", "value": "1594317600" }, { "id": 1111, "key": "_pickup_location_id", "value": "3495" }, { "id": 1112, "key": "_pickup_location_address", "value": { "country": "US", "state": "MO", "postcode": "63303", "city": "MO", "address_1": "4207 S Old Highway 94", "address_2": "Saint Charles" } }, { "id": 1113, "key": "_pickup_location_name", "value": "Heritage Crossing" }, { "id": 1114, "key": "_pickup_location_phone", "value": "636-939-0939" }, { "id": 1121, "key": "_pickup_items", "value": [ 140, 141 ] } ] } ]
However, I am unable to access it through array index notation in php. Are there getter and setter methods that will work to access the new info in shipping_lines? Is there another method I should be using to retrieve this data?
Please note – I am mostly a javascript developer, so I might be missing some core concept from php, but all of the reading I’ve been doing suggests that the methods I’m trying should work, so I’m just a bit lost. Any help would be greatly appreciated.
- The topic ‘API documentation?’ is closed to new replies.