Map WooCommerce order metadata to ShipStation Custom Fields 2 and 3 with filters. This guide shows how to configure the mapping and check it with a test order.
Note:
This is a Developer level doc. If you are unfamiliar working with code and resolving potential conflicts, we recommend you work with a Woo Agency Partner for larger projects, or find a WooCommerce developer on Codeable for smaller customizations. We are unable to provide support for customizations under our Support Policy.
Before you begin
↑ Back to topYou’ll need an active ShipStation for WooCommerce extension, a connected ShipStation store, and an eligible test order containing the order metadata you want to export. Identify the exact meta keys and use a test environment and a custom plugin that can run PHP filters. Confirm you can disable the customization if necessary.
The extension uses Custom Field 1 for coupon codes. The examples below map Custom Fields 2 and 3. Export only information appropriate for your store’s handling of customer data.
Map the fields
↑ Back to topAdd the following to your custom plugin and replace the example keys with your order meta keys. Omit either filter if you only need one field.
add_filter(
'woocommerce_shipstation_export_custom_field_2',
function () {
return '_example_order_meta_key';
}
);
add_filter(
'woocommerce_shipstation_export_custom_field_3',
function () {
return '_another_example_order_meta_key';
}
);
Activate the custom plugin in your test environment. The metadata must exist on the order before ShipStation imports it.
Verify the export
↑ Back to topImport an eligible test order containing the mapped metadata into ShipStation. Check that the values appear in the expected custom fields. Test the connection type your store uses: the extension’s REST and legacy XML export paths both use these mappings, but a successful test of one path doesn’t verify the other.
Adjust exported values
↑ Back to topTo modify a mapped value, use woocommerce_shipstation_export_custom_field_2_value or woocommerce_shipstation_export_custom_field_3_value. Each filter receives the value and order ID. The value filter runs only when its corresponding meta-key filter returns a nonempty key.
Troubleshooting
↑ Back to topIf a field is empty, confirm the custom plugin is active, the configured key exactly matches order metadata, and the value exists on the test order before import. Confirm the order imported and check the connection if it didn’t. To stop exporting the mapped fields, disable the custom plugin or remove the relevant filters, then test another order.
Questions and support
↑ Back to topDo you still have questions and need assistance?
- Get in touch with a Happiness Engineer via our Help Desk. We provide support for extensions developed by and/or sold on WooCommerce.com, and Jetpack/WordPress.com customers.
- If you are not a customer, we recommend finding help in the WooCommerce support forum or hiring a Woo Agency Partner. These are trusted agencies with a proven track record of building highly customized, scalable online stores. Learn more about Woo Agency Partners.