1

Hi i have trouble in woocommerce custom billing field in checkout page and i want to get value from get_meta_data() in some field, in my script is :

$item_meta_data = $orderID->get_meta_data();

and the variable $item_meta_data has array like this :

Array ( [0] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 67469 [key] => _billing_dropship_name [value] => KINARA STOREZ ) [data:protected] => Array ( [id] => 67469 [key] => _billing_dropship_name [value] => KINARA STOREZ ) ) [1] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 67470 [key] => _billing_dropship_telp [value] => 081212083563 ) [data:protected] => Array ( [id] => 67470 [key] => _billing_dropship_telp [value] => 081212083563 ) ) [2] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 67471 [key] => billing_dropship_name [value] => KINARA STOREZ ) [data:protected] => Array ( [id] => 67471 [key] => billing_dropship_name [value] => KINARA STOREZ ) ) [3] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 67472 [key] => billing_dropship_telp [value] => 081212083563 ) [data:protected] => Array ( [id] => 67472 [key] => billing_dropship_telp [value] => 081212083563 ) ) [4] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 67476 [key] => _order_stock_reduced [value] => yes ) [data:protected] => Array ( [id] => 67476 [key] => _order_stock_reduced [value] => yes ) ) [5] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 67847 [key] => wf_invoice_number [value] => 7486 ) [data:protected] => Array ( [id] => 67847 [key] => wf_invoice_number [value] => 7486 ) ) [6] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 68951 [key] => _wcpdf_invoice_settings [value] => Array ( [enabled] => 1 [display_shipping_address] => 1 [display_phone] => 1 [display_date] => invoice_date [display_number] => invoice_number [number_format] => Array ( [prefix] => [suffix] => [padding] => ) [my_account_buttons] => available [paper_size] => a4 [font_subsetting] => 1 [header_logo] => [shop_name] => Array ( [default] => Pengirim ) [shop_address] => Array ( [default] => [biiling_dropship_name] [biiling_dropship_no_telp] ) [footer] => Array ( [default] =>
) [extra_1] => Array ( [default] => ) [extra_2] => Array ( [default] => ) [extra_3] => Array ( [default] => ) ) ) [data:protected] => Array ( [id] => 68951 [key] => _wcpdf_invoice_settings [value] => Array ( [enabled] => 1 [display_shipping_address] => 1 [display_phone] => 1 [display_date] => invoice_date [display_number] => invoice_number [number_format] => Array ( [prefix] => [suffix] => [padding] => ) [my_account_buttons] => available [paper_size] => a4 [font_subsetting] => 1 [header_logo] => [shop_name] => Array ( [default] => Pengirim ) [shop_address] => Array ( [default] => [biiling_dropship_name] [biiling_dropship_no_telp] ) [footer] => Array ( [default] =>
) [extra_1] => Array ( [default] => ) [extra_2] => Array ( [default] => ) [extra_3] => Array ( [default] => ) ) ) ) [7] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 68952 [key] => _wcpdf_invoice_date [value] => 1541402193 ) [data:protected] => Array ( [id] => 68952 [key] => _wcpdf_invoice_date [value] => 1541402193 ) ) [8] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 68953 [key] => _wcpdf_invoice_date_formatted [value] => 2018-11-05 07:16:33 ) [data:protected] => Array ( [id] => 68953 [key] => _wcpdf_invoice_date_formatted [value] => 2018-11-05 07:16:33 ) ) [9] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 68954 [key] => _wcpdf_invoice_number [value] => 10 ) [data:protected] => Array ( [id] => 68954 [key] => _wcpdf_invoice_number [value] => 10 ) ) [10] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 68955 [key] => _wcpdf_invoice_number_data [value] => Array ( [number] => 10 [formatted_number] => 10 [prefix] => [suffix] => [document_type] => invoice [order_id] => 7486 [padding] => ) ) [data:protected] => Array ( [id] => 68955 [key] => _wcpdf_invoice_number_data [value] => Array ( [number] => 10 [formatted_number] => 10 [prefix] => [suffix] => [document_type] => invoice [order_id] => 7486 [padding] => ) ) ) [11] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 74941 [key] => _download_permissions_granted [value] => yes ) [data:protected] => Array ( [id] => 74941 [key] => _download_permissions_granted [value] => yes ) ) [12] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 75958 [key] => _wcpdf_packing_slip_date [value] => 1541414612 ) [data:protected] => Array ( [id] => 75958 [key] => _wcpdf_packing_slip_date [value] => 1541414612 ) ) [13] => WC_Meta_Data Object ( [current_data:protected] => Array ( [id] => 75959 [key] => _wcpdf_packing_slip_date_formatted [value] => 2018-11-05 10:43:32 ) [data:protected] => Array ( [id] => 75959 [key] => _wcpdf_packing_slip_date_formatted [value] => 2018-11-05 10:43:32 ) ) )

i want to get value off biiling_dropship_name and biiling_dropship_no_telp, how i can do that ? i have try using $item_meta_data-> biiling_dropship_name but not working, i think some one can help me, thank you.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
CSM Media
  • 61
  • 7
  • I think you miss understand, your answer is wrong and not same on my question, what i need is to get get_meta_data() spesific value, not meta_formatter. – CSM Media Nov 05 '18 at 12:04

0 Answers0