douque8861
2018-02-09 07:14
浏览 56
已采纳

Woocommerce - 在Checkout中获取自定义字段的价值

I have a nimble question that i am not getting any answer of. I have added a custom field using "Checkout Field Editor" in Woocommerce Checkout fields. The field is given below and seems to be working fine.

 <input class="input-text " name="wc_order_field_7542" id="wc_order_field_7542" placeholder="Pickup Date" value="" type="text">

However, now I am working on a plugin and want to get value inputted in this specific field and cannot seem to figure out. For the other fields I am simply doing the following as I am doing for "billing email" and it is working:

public function get_billing_email() {
        $billing_email = $this->order->billing_email;
        return apply_filters( 'xc_woo_cloud_print_billing_email', $billing_email, $this );
    }
public function billing_email() {
    echo $this->get_billing_email();
}

I am sure I am forgetting something and not doing something right.

Any help is appreciated.

图片转代码服务由CSDN问答提供 功能建议

我有一个敏捷的问题,我没有得到任何答案。 我在Woocommerce Checkout字段中使用“Checkout Field Editor”添加了一个自定义字段。 该字段在下面给出,似乎工作正常。

 &lt; input class =“input-text”name =“wc_order_field_7542”id =“wc_order_field_7542”placeholder =“Pickup 日期“value =”“type =”text“&gt; 
   
 
 

但是,现在我正在处理插件并想要在此特定字段中输入值 似乎无法弄清楚。 对于其他字段,我只是在做“收费电子邮件”时正在执行以下操作,它正在运行:

  public function get_billing_email(){
 $ billing_email = $  this-&gt; order-&gt; billing_email; 
返回apply_filters('xc_woo_cloud_print_billing_email',$ billing_email,$ this); 
} 
公共函数billing_email(){
 echo $ this-&gt; get_billing_email(); 
  } 
   
 
 

我确信我忘了什么,不做正确的事情。

感谢任何帮助。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题