Здравствуйте
Подскажите, пожалуйста, как получить данные из такого массива. Именно что хранится в @meta_data@
Изначально пробовал вызывать через цикл
foreach ($data['line_items'] as $meta) {
echo '<pre>';
var_dump($meta['meta_data']);
echo '</pre>';
}
Но он выдает NULL
object(WC_Order_Item_Product)#18707 (11) {
["extra_data":protected]=>
array(9) {
["product_id"]=>
int(0)
["variation_id"]=>
int(0)
["quantity"]=>
int(1)
["tax_class"]=>
string(0) ""
["subtotal"]=>
int(0)
["subtotal_tax"]=>
int(0)
["total"]=>
int(0)
["total_tax"]=>
int(0)
["taxes"]=>
array(2) {
["subtotal"]=>
array(0) {
}
["total"]=>
array(0) {
}
}
}
["data":protected]=>
array(11) {
["order_id"]=>
int(22108)
["name"]=>
string(7) "Product"
["product_id"]=>
int(21822)
["variation_id"]=>
int(22078)
["quantity"]=>
int(1)
["tax_class"]=>
string(0) ""
["subtotal"]=>
string(1) "0"
["subtotal_tax"]=>
string(1) "0"
["total"]=>
string(1) "0"
["total_tax"]=>
string(1) "0"
["taxes"]=>
array(2) {
["total"]=>
array(0) {
}
["subtotal"]=>
array(0) {
}
}
}
["cache_group":protected]=>
string(11) "order-items"
["meta_type":protected]=>
string(10) "order_item"
["object_type":protected]=>
string(10) "order_item"
["id":protected]=>
int(22)
["changes":protected]=>
array(0) {
}
["object_read":protected]=>
bool(true)
["default_data":protected]=>
array(11) {
["order_id"]=>
int(0)
["name"]=>
string(0) ""
["product_id"]=>
int(0)
["variation_id"]=>
int(0)
["quantity"]=>
int(1)
["tax_class"]=>
string(0) ""
["subtotal"]=>
int(0)
["subtotal_tax"]=>
int(0)
["total"]=>
int(0)
["total_tax"]=>
int(0)
["taxes"]=>
array(2) {
["subtotal"]=>
array(0) {
}
["total"]=>
array(0) {
}
}
}
["data_store":protected]=>
object(WC_Data_Store)#18706 (4) {
["instance":"WC_Data_Store":private]=>
object(WC_Order_Item_Product_Data_Store)#18705 (4) {
["internal_meta_keys":protected]=>
array(20) {
[0]=>
string(9) "_order_id"
[1]=>
string(5) "_name"
[2]=>
string(11) "_product_id"
[3]=>
string(13) "_variation_id"
[4]=>
string(9) "_quantity"
[5]=>
string(10) "_tax_class"
[6]=>
string(9) "_subtotal"
[7]=>
string(13) "_subtotal_tax"
[8]=>
string(6) "_total"
[9]=>
string(10) "_total_tax"
[10]=>
string(6) "_taxes"
[11]=>
string(11) "_product_id"
[12]=>
string(13) "_variation_id"
[13]=>
string(4) "_qty"
[14]=>
string(10) "_tax_class"
[15]=>
string(14) "_line_subtotal"
[16]=>
string(18) "_line_subtotal_tax"
[17]=>
string(11) "_line_total"
[18]=>
string(9) "_line_tax"
[19]=>
string(14) "_line_tax_data"
}
["meta_type":protected]=>
string(10) "order_item"
["object_id_field_for_meta":protected]=>
string(13) "order_item_id"
["must_exist_meta_keys":protected]=>
array(0) {
}
}
["stores":"WC_Data_Store":private]=>
array(38) {
["coupon"]=>
string(24) "WC_Coupon_Data_Store_CPT"
["customer"]=>
string(22) "WC_Customer_Data_Store"
["customer-download"]=>
string(31) "WC_Customer_Download_Data_Store"
["customer-download-log"]=>
string(35) "WC_Customer_Download_Log_Data_Store"
["customer-session"]=>
string(30) "WC_Customer_Data_Store_Session"
["order"]=>
string(23) "WC_Order_Data_Store_CPT"
["order-refund"]=>
string(30) "WC_Order_Refund_Data_Store_CPT"
["order-item"]=>
string(24) "WC_Order_Item_Data_Store"
["order-item-coupon"]=>
string(31) "WC_Order_Item_Coupon_Data_Store"
["order-item-fee"]=>
string(28) "WC_Order_Item_Fee_Data_Store"
["order-item-product"]=>
string(32) "WC_Order_Item_Product_Data_Store"
["order-item-shipping"]=>
string(33) "WC_Order_Item_Shipping_Data_Store"
["order-item-tax"]=>
string(28) "WC_Order_Item_Tax_Data_Store"
["payment-token"]=>
string(27) "WC_Payment_Token_Data_Store"
["product"]=>
string(25) "WC_Product_Data_Store_CPT"
["product-grouped"]=>
string(33) "WC_Product_Grouped_Data_Store_CPT"
["product-variable"]=>
string(34) "WC_Product_Variable_Data_Store_CPT"
["product-variation"]=>
string(35) "WC_Product_Variation_Data_Store_CPT"
["shipping-zone"]=>
string(27) "WC_Shipping_Zone_Data_Store"
["webhook"]=>
string(21) "WC_Webhook_Data_Store"
["report-revenue-stats"]=>
string(63) "Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore"
["report-orders"]=>
string(57) "Automattic\WooCommerce\Admin\API\Reports\Orders\DataStore"
["report-orders-stats"]=>
string(63) "Automattic\WooCommerce\Admin\API\Reports\Orders\Stats\DataStore"
["report-products"]=>
string(59) "Automattic\WooCommerce\Admin\API\Reports\Products\DataStore"
["report-variations"]=>
string(61) "Automattic\WooCommerce\Admin\API\Reports\Variations\DataStore"
["report-products-stats"]=>
string(65) "Automattic\WooCommerce\Admin\API\Reports\Products\Stats\DataStore"
["report-variations-stats"]=>
string(67) "Automattic\WooCommerce\Admin\API\Reports\Variations\Stats\DataStore"
["report-categories"]=>
string(61) "Automattic\WooCommerce\Admin\API\Reports\Categories\DataStore"
["report-taxes"]=>
string(56) "Automattic\WooCommerce\Admin\API\Reports\Taxes\DataStore"
["report-taxes-stats"]=>
string(62) "Automattic\WooCommerce\Admin\API\Reports\Taxes\Stats\DataStore"
["report-coupons"]=>
string(58) "Automattic\WooCommerce\Admin\API\Reports\Coupons\DataStore"
["report-coupons-stats"]=>
string(64) "Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats\DataStore"
["report-downloads"]=>
string(60) "Automattic\WooCommerce\Admin\API\Reports\Downloads\DataStore"
["report-downloads-stats"]=>
string(66) "Automattic\WooCommerce\Admin\API\Reports\Downloads\Stats\DataStore"
["admin-note"]=>
string(44) "Automattic\WooCommerce\Admin\Notes\DataStore"
["report-customers"]=>
string(60) "Automattic\WooCommerce\Admin\API\Reports\Customers\DataStore"
["report-customers-stats"]=>
string(66) "Automattic\WooCommerce\Admin\API\Reports\Customers\Stats\DataStore"
["report-stock-stats"]=>
string(62) "Automattic\WooCommerce\Admin\API\Reports\Stock\Stats\DataStore"
}
["current_class_name":"WC_Data_Store":private]=>
string(32) "WC_Order_Item_Product_Data_Store"
["object_type":"WC_Data_Store":private]=>
string(18) "order-item-product"
}
["meta_data":protected]=>
array(3) {
[0]=>
object(WC_Meta_Data)#18687 (2) {
["current_data":protected]=>
array(3) {
["id"]=>
int(224)
["key"]=>
string(30) "кол-во-сообщений"
["value"]=>
string(2) "10"
}
["data":protected]=>
array(3) {
["id"]=>
int(224)
["key"]=>
string(30) "кол-во-сообщений"
["value"]=>
string(2) "10"
}
}
[1]=>
object(WC_Meta_Data)#18685 (2) {
["current_data":protected]=>
array(3) {
["id"]=>
int(225)
["key"]=>
string(25) "тип-сообщения"
["value"]=>
string(12) "Text + Audio"
}
["data":protected]=>
array(3) {
["id"]=>
int(225)
["key"]=>
string(25) "тип-сообщения"
["value"]=>
string(12) "Text + Audio"
}
}
[2]=>
object(WC_Meta_Data)#18684 (2) {
["current_data":protected]=>
array(3) {
["id"]=>
int(226)
["key"]=>
string(14) "вариант"
["value"]=>
string(15) "Message + Death"
}
["data":protected]=>
array(3) {
["id"]=>
int(226)
["key"]=>
string(14) "вариант"
["value"]=>
string(15) "Message + Death"
}
}
}
}