{"id":1289,"date":"2021-05-08T09:45:52","date_gmt":"2021-05-08T09:45:52","guid":{"rendered":"https:\/\/ithemelandco.com\/docs\/woocommerce-bulk-orders-editing\/?p=1289"},"modified":"2024-04-22T06:37:00","modified_gmt":"2024-04-22T06:37:00","slug":"how-to-add-custom-fields-meta-key-to-woocommerce-bulk-order-editing-plugin","status":"publish","type":"post","link":"https:\/\/ithemelandco.com\/docs\/woocommerce-bulk-orders-editing\/how-to-add-custom-fields-meta-key-to-woocommerce-bulk-order-editing-plugin\/","title":{"rendered":"How to add custom fields\/meta key to WooCommerce bulk order editing plugin?"},"content":{"rendered":"\n
Adding custom fields and meta key to WooCommerce bulk orders editing plugin<\/a> is not a complicated task thanks to the options we have provided in the \u201cMeta Fields<\/strong>\u201d tab which can enable you to add them manually or automatically from orders.<\/p>\n\n\n\n The most amazing thing about adding \u201cCustom Fields<\/strong>\u201d and meta key to Order Table is that you have also access to them on the \u201cBulk Edit<\/strong>\u201d form, \u201cFilter Form<\/strong>\u201d and \u201cColumn Profile\u201d<\/strong> form just like other fields.<\/p>\n\n\n\n As shown below, there are two ways to add custom fields to our plugin:<\/p>\n\n\n\n Adding new fields manually is possible by following below steps:<\/p>\n\n\n\n By using this option, you can add all custom fields assigned to one of the orders to our plugin very fast and easy.<\/p>\n\n\n\n The process is the same as Manually<\/strong> method except that you have to type the ID no<\/strong>. Of your preferred order instead of the name of \u201cCustom Field\u201d<\/strong> in the Textbox<\/strong>.<\/p>\n\n\n\n As soon as Clicking on \u201c+\u201d<\/strong> sign after typing the ID no<\/strong>. Of the order, all custom fields related to that order will be added to the opposite box automatically and you can customize and save them accordingly.<\/p>\n\n\n\n Let\u2019s review some examples to make it more clear for you.<\/p>\n\n\n\n In this example, we want to add \u201cSpecial Offer Order<\/strong>” to the plugin. It’s worth mentioning that you can just add those custom fields to the plugin which have been already added to the WooCommerce order page. <\/p>\n\n\n\n So, pay attention to the attention you are typing in the Textbox<\/strong> box as it must be exactly the as the custom field name assigned to the WooCommerce order.<\/p>\n\n\n\n To add custom fields Automatically from order no. 2245<\/strong>, we typed this no. On the textbox:<\/p>\n\n\n\n As shown below, all custom fields assigned to that order no. were added to the opposite box.<\/p>\n\n\n\n As we mentioned above by clicking on \u201c+\u201d,<\/strong> you can see the custom fields in the opposite box and now we are able to customize them by using below options:<\/p>\n\n\n\n If you want our plugin to display this meta field with different names on the other forms, you can type a new name in the Textbox<\/strong> in front of it.<\/p>\n\n\n\n For instance, we typed \u201cSpecial Offer<\/strong>” in that box:<\/p>\n\n\n\n In the next box, you can choose a type for displaying the fields in the \u201cBulk Edit<\/strong>\u201d form and \u201cFilter Form<\/strong>\u201d.<\/p>\n\n\n\n We have listed some default types that you choose one of them to be assigned to the new fields including:<\/p>\n\n\n\n For example, we chose a Checkbox<\/strong> for \u201cSpecial order\u201d<\/strong> custom field as the data must be specified as a \u201cYes\/ No<\/strong>\u201d option. We also selected the Calendar<\/strong> type for \u201cDelivery Date<\/strong>\u201d to edit or filter the data of this custom field as a date.<\/p>\n\n\n\n To change the order of custom fields columns, you can easily hold the click on the \u201c\u201d<\/strong> icon at the right and drag & drop it anywhere you want.<\/p>\n\n\n\n It is also possible to delete each custom field by clicking on the \u201cX\u201d<\/strong> icon. So, the removed meta field won\u2019t be displayed in the plugin for editing or filtering.<\/p>\n\n\n\n To make our plugin display the custom fields added in the \u201cMeta Field\u201d<\/strong> tab, you need to click on \u201cSave Fields\u201d<\/strong>.<\/p>\n\n\n\n Now, let\u2019s see how these fields are available for editing and filtering in \u201cBulk Edit<\/strong>\u201d form and \u201cFilter Form<\/strong>\u201d.<\/p>\n\n\n\n As soon as saving the custom fields in the \u201cMeta Fields<\/strong>\u201d tab, all of them will be added to the \u201cFilter Form<\/strong>\u201d under \u201cCustom Field\u201d<\/strong> tab.<\/p>\n\n\n\n For example, we tried to filter orders with Delivery<\/strong> Date from 2012\/03\/07<\/strong> to 17<\/strong> by following below steps:<\/p>\n\n\n\n As illustrated below, those orders were filtered successfully:<\/p>\n\n\n\n Adding custom fields to the order table is easily possible via \u201cColumn Profiles\u201d<\/strong> form.<\/p>\n\n\n\n To manage the columns displayed in the order table you can:<\/p>\n\n\n\n After saving the custom fields and meta key, you have access to them on the \u201cBulk Edit<\/strong>\u201d form by pressing the \u201cBulk Edit<\/strong>\u201d button on the main page and going to \u201cCustom Fields<\/strong>\u201d tab.<\/p>\n\n\n\n As shown below, both custom fields we added before displayed in the \u201cCustom Fields<\/strong>\u201d tab:<\/p>\n\n\n\n For example, we clicked on the box in front of \u201cDelivery Date<\/strong>\u201d and as you can see below, the built-in calendar was opened.<\/p>\n\n\n\n So, we picked a date to be assigned to this field for the filtered orders:<\/p>\n\n\n\nAdding custom fields via meta fields tab<\/strong><\/h2>\n\n\n\n
Manually <\/strong><\/h3>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
Automatically from orders<\/strong><\/h3>\n\n\n\n
Example 1: Add custom fields to the plugin <\/strong><\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Example 2: Adding a custom field from Order automatically <\/strong><\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Change the name<\/strong><\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Change the type <\/strong>of custom fields<\/h3>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Change the order of custom fields<\/strong>\/meta key<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Delete custom fields <\/strong><\/h3>\n\n\n\n
Save custom fields<\/strong>\/meta key<\/h3>\n\n\n\n
Using custom fields in Filter Form <\/strong><\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Add custom fields and meta keys columns to the order table <\/strong><\/h3>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
Bulk Edit Custom Fields<\/strong><\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n