WOOCOMMERCE ORDERS IN VERSION 3.0+ get protected data

Since Woocommerce mega major Update 3.0+ things have changed quite a lot:

So also the Order items properties will not be accessible as before in a  foreach loop and you will have to use this specific getter and setter methods instead.

Using some  WC_Order and  WC_Abstract_Order methods (example):

Get and access to the order data properties (in an array of values):

Get the order items and access the data with  WC_Order_Item_Product and  WC_Order_Itemmethods:

So using  get_data() method allow us to access to the protected data (associative array mode)

by LoicTheAztec