Our Store Exporter Deluxe > Usage document explains how to add custom export fields to the Product export type, this same technique can add custom export fields to other export types except Orders.
This tutorial will explain how to add a static export field to the Order export type. The Orders export type is made up of two types of export fields:
- Order fields – Export fields related to the Order
- Order Item fields – Export fields related to the Order Items that make up an Order
This tutorial will not cover adding static Order Item fields or dynamic Order fields (e.g. accessing, Terms, Posts or the WordPress database to retrieve a value), see Adding static Order Item fields to the Orders export type which covers this. A future tutorial will cover dynamic Order fields.
Adding a single static Order field
To add a new static Order field add the following PHP snippet to your current WordPress Theme’s functions.php file:
View CodeAdding multiple static Order fields
To add multiple static Order fields add the following PHP snippet to your current WordPress Theme’s functions.php file:
View Code
This works great for adding one static field! Do you have a sample snippet showing multiple static fields?
Hi Alvaro, sure! I’ll add an update to the above post at the bottom with an example of multiple static fields 🙂
Pingback: Adding static Order Item fields to the Orders export type | Visser Labs