douyin2435 2019-03-28 18:34
浏览 52

在结帐后将饼干值保存为Woocommerce中的元数据

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 yolov8边框坐标
    • ¥15 matlab中使用gurobi时报错
    • ¥15 WPF 大屏看板表格背景图片设置
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真