You can export add-on field data from orders to ShipStation using a snippet. ShipStation only allow two fields to be sent – custom field 2 and custom field 3.
You’ll need to use the following snippet, updating the return values for each filter with the name of the data you want to send. The name can be formed by adding an underscore before the field label name -so if your field label is ‘Upload’, the name will be ‘_Upload’.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Send add-on field data to ShipStation | |
* @link https://woocommerce.com/document/shipstation-for-woocommerce/ | |
*/ | |
// This is for custom field 3 | |
function prefix_shipstation_custom_field_2() { | |
return '_meta_key_2'; // Replace this with the key of your custom field | |
} | |
add_filter( 'woocommerce_shipstation_export_custom_field_2', 'prefix_shipstation_custom_field_2' ); | |
// This is for custom field 3 | |
function prefix_shipstation_custom_field_3() { | |
return '_meta_key_3'; // Replace this with the key of your custom field | |
} | |
add_filter( 'woocommerce_shipstation_export_custom_field_3', 'prefix_shipstation_custom_field_3' ); |
Here’s how to add a snippet.