I want to save order meta data from plugin file to display ticket ID number to email notification, I am using a code which save Post ID by cookie to order meta data but the problem is my existing code grabs data from thankyou.php page which runs at last of woocommerce order process, is that possible to save the data directly from plugin files via cookies or any other method, so that I can display it easily on any php page ?
I am using the code from this thread How to get a cookie value in Woocommerce email notifications? It's an answer to one of my question.
This function prints the Ticket ID which is $post->ID in Email Template which I want to Save and Display in other php files.
if ( ! function_exists( 'yith_wcevti_set_args_mail_template' ) ) {
/**
* Define the args to mail template
* @param $post
* @return array|mixed|void
*/
function yith_wcevti_set_args_mail_template($post)
{
$args = array();
$post_meta = get_post_meta($post->ID, '', true);
Any help is appreciated.