I have a code like below but it returns the false
. There is data in $ggowlccpy_transaction_details_capture
and the order id is being correctly passed. This is for woocommerce order meta.
I don't know why it is getting saved.
<?php
$ggowlccpy_transaction_details_capture = array(
'merchant_ref' => $ggowlccpy_order_id,
'transaction_id' => $ggowlccpy_response['transaction_id'],
'transaction_tag' => $ggowlccpy_response['transaction_tag'],
'method' => $ggowlccpy_response['method'],
'amount' => $ggowlccpy_response['amount'],
'currency_code' => $ggowlccpy_response['currency'],
'positionofsave' => 'captured',
);
update_post_meta(
$post->ID,
'_ggowlccpy_trasaction_capture',
$ggowlccpy_transaction_details_capture
);
add_post_meta(
$post->ID,
'_ggowlccpy_refund_details_get',
base64_encode( serialize( $ggowlccpy_transaction_details_capture ) )
);
$data = get_post_meta(
$ggowlccpy_order_id,
$key = '_ggowlccpy_refund_details_get',
$single = false
);
$tb_meta_unserialized = unserialize( base64_decode( $data ) );
error_log( var_export( $tb_meta_unserialized, 1 ) );
echo $tb_meta_unserialized;
get_post_meta( $ggowlccpy_order_id,
- no, that should be the post ID not the order ID. So that's what's failing: you actually want to search the post meta for a serialized value and you don't know the post ID? That's not get_post_metae.