{"id":1032,"date":"2021-05-06T11:55:09","date_gmt":"2021-05-06T11:55:09","guid":{"rendered":"https:\/\/ithemelandco.com\/docs\/woocommerce-bulk-coupons-editing\/?p=1032"},"modified":"2024-04-23T09:37:03","modified_gmt":"2024-04-23T09:37:03","slug":"add-custom-field-meta-key-to-woocommerce-bulk-coupon-editing-plugin","status":"publish","type":"post","link":"https:\/\/ithemelandco.com\/docs\/woocommerce-bulk-coupons-editing\/add-custom-field-meta-key-to-woocommerce-bulk-coupon-editing-plugin\/","title":{"rendered":"How to add custom field \/ meta key to WooCommerce bulk coupon editing plugin?"},"content":{"rendered":"\n
It\u2019s really wonderful that you can add all custom field that are defined in the WooCommerce coupon page personally to the coupon table of our plugin. <\/p>\n\n\n\n
The more amazing point is that not only you can see the custom fields on the coupon table. But also you are able to bulk edit coupons custom field or filter your WooCommerce coupons according to them.<\/p>\n\n\n\n
In this tutorial, we have provided an ultimate guide to help you add, edit or filter custom fields in WooCommerce bulk coupons editing plugin<\/a>. Let\u2019s face it.<\/p>\n\n\n\n To add custom field, you need to go to the main page of our plugin by navigating to the below address:<\/p>\n\n\n\n WordPress Dashboard > Pro bulk bundle > Woo Coupons <\/strong><\/p>\n\n\n\n Then at the top of the page, click on “Meta Fields<\/strong>” to open the related page.<\/p>\n\n\n\n As you can see in the below picture , the “Meta Fields<\/strong>” page is divided in two parts. At the left part, you can search the custom fields manually or automatically from coupon. Then add it to the right part and customize it as you need.<\/p>\n\n\n\n Let\u2019s try to add some custom fields by using both methods.<\/p>\n\n\n\n To add a custom field manually, you have to type the exact name of it in the Textbox<\/strong> provided in this section.<\/p>\n\n\n\n For example, consider that we have created a custom field on the WooCommerce page to publish some coupon monthly on a specific date and named it \u201cMonthly<\/strong>“.<\/p>\n\n\n\n To add this custom field to the plugin, follow the below steps:<\/p>\n\n\n\n As you can see the custom field has been added to the opposite box. But it is not added to the plugin, yet.\u00a0<\/p>\n\n\n\n You can also add other custom fields by the same way. For example, we tried to add another meta field called “Gift”<\/strong> which specify if a coupon is a gift or not by \u201cYes\/No<\/strong>\u201d check box.<\/p>\n\n\n\n As shown below, we typed \u201cGift<\/strong>\u201d in the Textbox under \u201cManually<\/strong>\u201d field and clicked on \u201c+\u201d.<\/strong><\/p>\n\n\n\n It is also possible to add the custom fields of one coupon automatically. For this, you need typing its “ID<\/strong>” on the text box under \u201cAutomatically From Coupon<\/strong>\u201d and click on \u201c+\u201d.<\/strong><\/p>\n\n\n\n Now, both custom fields have been added to the opposite box. This enable you to customize the features of these custom fields as your requirements before saving them to the plugin and having access to them for editing or filtering.<\/p>\n\n\n\n In the next part we will show you how to customize custom fields to suit your needs.<\/p>\n\n\n\n To customize \u201cCustom fields<\/strong>\u201d you have access to the different options in the right box including:<\/p>\n\n\n\n The first box in front of each custom field is a Textbox<\/strong>. This field can help you to assign a new name to that field for displaying on different pages of our plugin.<\/p>\n\n\n\n If you don\u2019t type anything in the Textbox<\/strong>, the custom fields will be displayed with their original names.<\/p>\n\n\n\n For example, we typed “Monthly Coupon<\/strong>” in front of the first field and “Coupon as a gift<\/strong>” in the second custom field. We will see later this name in all pages of our plugin.<\/p>\n\n\n\n The second and third boxes in front of the custom fields enable you to specify how our plugin must treat each meta field. It also determine what kinds of fields must be shown in front of each one in “bulk edit” form or “filter form”.<\/p>\n\n\n\n By clicking on the third Textbox, a list of all available fields will be displayed which are:<\/p>\n\n\n\n You need to choose one of the items in the list according to the values assigned to the custom fields in the WooCommerce coupon page.<\/p>\n\n\n\n For example, we chose a calendar for the \u201cMonthly custom field<\/strong>\u201d because the plugin must treat it as a date field.<\/p>\n\n\n\n We have also chosen Checkbox<\/strong> for Gift<\/strong> meta field because as we mentioned before it must be defined by marking \u201cYes or No\u201d<\/strong> Checkbox.<\/p>\n\n\n\n At the right of the customization box, you can see two signs: \u201c\u00d7\u201d<\/strong>, \u201c=\u201d<\/strong><\/p>\n\n\n\n If you click on \u201c=\u201d,<\/strong> it is possible to rearrange the custom fields and determine in which order they must be displayed in the plugin.<\/p>\n\n\n\n If you click on \u201c\u00d7\u201d,<\/strong> the meta field will be removed and it won\u2019t be displayed in the plugin anymore.<\/p>\n\n\n\n After finishing the customization, it\u2019s time to add those custom fields to the plugin. Let\u2019s do it.<\/p>\n\n\n\n By clicking on \u201cSave Fields<\/strong>\u201d, all custom fields listed in the second box will be added to the plugin.<\/p>\n\n\n\n Don\u2019t forget that you can add as many custom fields as you have already in the WooCommerce coupon page to our plugin.<\/p>\n\n\n\n When you see the “success” massage at the top of the page, all added custom fields are available in our plugin as we will see in the next section.<\/p>\n\n\n\n After pressing Save Fields, you have access to all Custom fields added from the “Meta Fields<\/strong>” tab on the \u201cFilter Form<\/strong>\u201d.<\/p>\n\n\n\n As you can see below, if you open the \u201cFilter Form\u201d<\/strong> and click on the \u201cCustom fields<\/strong>\u201d tab, all meta fields will be displayed. Then you can use any of them to filter your products accordingly.<\/p>\n\n\n\n \u201cCustom fields<\/strong>\u201d that you have added in the “Meta Fields<\/strong>” tab are also available in the \u201cBulk Form\u201d<\/strong>. You access it from \u201cBulk Edit<\/strong>\u201d button on the main page of our plugin and opening \u201cCustom fields<\/strong>\u201d tab.<\/p>\n\n\n\n As we mentioned before, when you assign a name to the meta field, it will be displayed everywhere in our plugin by that name. So, we can see the \u201cMonthly coupon<\/strong>\u201d field in the \u201cBulk Edit<\/strong>\u201d form as we expected.<\/p>\n\n\n\n To bulk edit this field, you have access to the built-in calendar<\/strong> because you have defined its value as a date.<\/p>\n\n\n\n Add \u201cCustom fields<\/strong>\u201d columns to the Coupon table <\/p>\n\n\n\n It is also possible to add custom field columns to the Coupon table by following below steps:<\/p>\n\n\n\n As shown below, you can see the values of \u201cCustom fields<\/strong>\u201d columns in the Coupon Table.<\/p>\n\n\n\n Like other columns on the table, you can use the \u201cbind edit<\/strong>\u201d option to change the value of \u201cCustom fields<\/strong>\u201d columns at the same time.<\/p>\n\n\n\nAdd custom fields <\/strong><\/h2>\n\n\n\n
<\/a>
Add coupons’ custom fields manually <\/strong><\/h3>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Add coupons’ custom fields automatically <\/strong><\/h3>\n\n\n\n
Customize the coupon custom fields <\/strong><\/h2>\n\n\n\n
Assign a name<\/strong><\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Change the Type <\/strong><\/h3>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Change order and delete added custom fields <\/strong><\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Save Fields <\/strong><\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Filter WooCommerce coupons by Custom Field<\/strong><\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Bulk Edit WooCommerce Coupon Custom Fields<\/strong><\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Bind Edit Coupons Custom Fields <\/strong><\/h2>\n\n\n\n