Using object model I can output individual item data like so:
$order->items[0]->item_qty -- For item 1
$order->items[1]->item_qty -- For item 2
$order->items[0]->entry_id -- For item 1
$order->items[1]->entry_id -- For item 2
As I wont know how many items are in the object, I can't have [0] or [1]. I would like to therefore loop through somehow, but I am unsure how this would work with a foreach statement.
Could anyone show me how this could be done?
EDIT
foreach ($order as $obj) {
print_r($obj->items->item_qty);
}
Gives the following error:
Message: Trying to get property of non-object