Codexshaper / laravel-woocommerce

WooCommerce Rest API for Laravel
MIT License
198 stars 57 forks source link

Access orders content #22

Closed invaders-xx closed 4 years ago

invaders-xx commented 4 years ago

Hi @maab16,

When I do a find on an order I do: $order = Order::find($id); I get all the information in the $order object. But I am wondering how to access the data: When I do $order->number, I got an error and when I do $order['number'] it's fine When I do $order['billing']['first_name'] I got an error but when I do $order['billing']->first_name, it's fine.

I saw that the function find returns an collection object, do you have any inputs on that ?

Many thanks in advance,

David

maab16 commented 4 years ago

@invaders-xx

Thanks for creating an issue here. Yes, It was collection related issue. I fixed the issue and release new version v2.5. Please update the package and make sure the package version 2.5 or above.

Regards, Md Abu Ahsan Basir

Codexshaper commented 4 years ago

Don't forget to press the star button on this package to rate this package if you like this package and want to more flexible feature. It helps the contributor to contribute more.

Thanks

invaders-xx commented 4 years ago

rated ;-)

invaders-xx commented 4 years ago

works like a charm !! Many thanks!!