The Admin Custom Order Fields extension allows you to add fields to an order for details, notes, dates, and more. These fields can also be used to sort or filter orders in the order dashboard, and are geared towards streamlining and centralizing order information and notes.
By default, these fields can only be viewed by the administrator, but can optionally be included on the customer’s “My Order” page. To learn how to optionally include this information, check out the section on Field Attributes.
Installation
↑ Back to top
- Download the extension from your WooCommerce dashboard
- Go to Plugins > Add New > Upload and select the ZIP file you just downloaded
- Click Install Now, and then Activate
- Go to WooCommerce > Custom Order Fields and read the next section to learn how to use the plugin.
Setup and Configuration
↑ Back to topSetup
↑ Back to topField Types:
↑ Back to top- Text – Allows the admin to enter a short string of text for the field. For example, you could use this field to set a group name on a tour (can be used to sort alphabetically or to filter orders).
- Text Area – Allows the admin to enter a long string of text for the field. Useful for notes or customer requests (can be used to sort alphabetically).
- Radio – Creates a list with radio buttons in the order details to select one of multiple options (can be used to sort alphabetically or to filter orders).
- Select – Creates a drop-down menu in the order details to select one of multiple options (can be used to sort alphabetically/numerically or to filter orders).
- Checkbox – Creates a list with checkboxes in the order details to select one, several, or all of multiple options (can be used to filter orders).
- Multiselect – Creates a field to select one, several, or all of multiple values in the order details (can be used to filter orders).
- Date – Uses a pop-up calendar to select a date (can be used to sort by date or to filter orders by month).
|
(above Enter/Return on your keyboard). If you want to set a default value, enclose the value with a double asterisk, **
, before and after the name.
Field Attributes:
↑ Back to top- Required – Adds a red asterisk to the field to denote that it should be completed. Is not required to save or complete the order, and is merely a visual cue.
- Display in View Orders Screen – Adds the Order Field to the Orders Dashboard table and allows you to view the selected / entered information all in one screen.
- Allow Sorting on View Orders Screen – Allows you to sort orders alphabetically or numerically based on the field for which this attribute is selected.
- Allow Filtering on View Orders Screen – Allows you to filter orders (view only certain orders) based on the field for which this attribute is selected.
- Show in My Orders/Email – Displays the Order Field to the customer on their “My Orders” page or in emails.
Import and Export
↑ Back to topCustomer / Order CSV Export Compatibility
↑ Back to topadmin_custom_order_field_{fieldID}
and name its column in your format.
When using a default or built-in format, custom order fields are added as columns in your CSV order export automatically. Exported order data from this plugin will now include a new column for each admin custom order field as part of the exported CSV.
Column | Description | Outputted Value | Example |
---|---|---|---|
admin_custom_order_field | The value selected for the admin custom order field | String | FirstName |
Customer / Order XML Export
↑ Back to top<CustomFields>
wrapper is added to the XML output; while using a custom format, the wrapper will use your custom name from the field mapper. This wrapper will contain a <CustomField>
element for each field that’s part of the order. The field ID, admin name, and value (admin input) will be output for each field in the element.
The value for the field may vary based on the field type, such as the text entered, the option selected, or a “Yes / No” for checkboxes.
An example of expected XML output:
<CustomFields> <CustomField> <ID>field ID</ID> <Name>field admin name</Name> <Value>field's input for this order</Value> </CustomField> </CustomFields>
CSV Import Compatibility
↑ Back to top_wc_acof_{id}
where {id}
is replaced by the integer id of the field. This id is clearly visible next to the label of each field you have created, so to import this data you’d title your columns like so: meta:_wc_acof_{id}
. All field values (except for Multiselect and Checkbox field types) can be easily imported.
Multiselect and Checkbox fields can only be imported the same way if only one of the options is set. We’re working on a way to import multiple values for a field, but this isn’t currently possible until automatic support is added.
For Developers
↑ Back to top_wc_acof_{id}
where {id}
is replaced by the integer id of the field. This id is clearly visible next to the label of each field you have created:
Once you know the id, you can use get_post_meta( $order_id, '_wc_acof_{id}', true )
to get the value of that custom field for a particular order.
Need to populate field options from another data source? You could do so dynamically with the wc_admin_custom_order_field_options
filter — see an example here.
Frequently Asked Questions
↑ Back to topQ: Are there any character limits for the “text” or “text area” types? A: No, these types have no character limits.
Q: Can the “text” or “text area” types accept HTML? A: Yes, these fields accept limited HTML like link tags. HTML can be used only in the value or content of the text box / textarea, HTML is not accepted in any field label.
Q: Can I export my custom field data? A: Yes! See our section above about using the CSV Order / Customer Exporter.
Q: If I show customers the order custom fields in the “My Account” section and emails, will this work with custom order statuses and custom emails? A: If you use the Order Status Manager plugin to trigger these emails, custom order fields will show within these emails still below the order table. For example, if you send a delivery details email when the order status is updated to “Out for Delivery”, the email will include your admin custom order fields.