使自定义结帐字段在Woocommerce管理员订单单页中显示为可编辑 [英] Make custom checkout fields appear as editable in Woocommerce admin order single pages

查看:103
本文介绍了使自定义结帐字段在Woocommerce管理员订单单页中显示为可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WooCommerce Checkout字段中添加了字段;有些带有插件(WooCommerce Checkout字段编辑器和WooCommerce Checkout附加组件),有些带有功能。

I added fields to the WooCommerce Checkout field; Some with a plugin ( WooCommerce Checkout Field Editor and WooCommerce Checkout Add-Ons ) and others with a function.

我可以将这些字段导出为CSV,但是如何编辑他们在订单管理页面?有时,我一个用户可能会忘记添加他们的ClientCode或ID号,然后我希望能够手动添加它。

I can export these fields to CSV, but How can I edit them in the order admin page? Sometimes I a user might forget to add their ClientCode or ID Number, and then I want to be able to manually add it.

谢谢您
Schalk

Thank you Schalk

推荐答案

如果需要要将现有的自定义结帐开票和运输字段添加到编辑订单页面中的可编辑
订单运输和计费部分,您将使用以下过滤器钩子中的一个或两个:

If you want to add existing custom checkout billing and shipping fields to the editable order shipping and billing sections in edit order pages, you will use one or both of the following filter hooks:


  • 对于可编辑的管理订单结算 部分: woocommerce_admin_billing_fields

  • 对于可编辑的管理订单运输 部分: woocommerce_admin_shipping_fields

  • For editable admin order "Billing" section: woocommerce_admin_billing_fields,
  • For editable admin order "Shipping" section: woocommerce_admin_shipping_fields.

示例用法和相关答案:

  • Editable admin custom billing fields error issue in Woocommerce 3
  • Add a drop down list of cities on admin orders pages in Woocommerce

这些字段值

对于其他非常自定义的结帐字段,您可以将其添加到可编辑框中在每个部分的底部使用这些动作钩子之一:

For others very custom checkout fields you can add them out of the editable boxes at the bottom of each section using one of those actions hooks:


  • 在常规部分的底部: woocommerce_admin_order_data_after_order_details

  • 在结算部分的底部: woocommerce_admin_order_data_after_billing_address

  • 在运输部分的底部: woocommerce_admin_order_data_after_shipping_address

  • At the bottom of "General" section: woocommerce_admin_order_data_after_order_details
  • At the bottom of "Billing" section: woocommerce_admin_order_data_after_billing_address
  • At the bottom of "Shipping" section: woocommerce_admin_order_data_after_shipping_address

然后您将必须添加具有相同键(名称属性)的类似可编辑字段,并使用 save_post_shop_order 动作挂钩…

Then you will have to add similar editable fields, with the same keys (name attribute) and use save_post_shop_order action hook…

这篇关于使自定义结帐字段在Woocommerce管理员订单单页中显示为可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆