Title: Using Shipstation Order Information Fields
Last modified: May 13, 2019

---

# Using Shipstation Order Information Fields

 *  Resolved [dwdonline](https://wordpress.org/support/users/dwdonline/)
 * (@dwdonline)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/using-shipstation-order-information-fields/)
 * I am trying to add product options for WooCommerce to be sent to Shipstation.
   I am able to accomplish this when editing class-wc-shipstation-api-export.php
   by inserting the following code just after line 273 – just before the first instance
   of $items_xml->appendChild( $item_xml ); .
 *     ```
                           $sashPreview = $item['vpc-custom-data']['preview_saved'];
                           //Get the flag sides for dual-country sash
                           $sashSideOne = $item['vpc-cart-data']['Why'];
   
                           if ( !empty( $sashPreview ) ) {
                               if ( !empty( $sashSideOne ) ) {
                                   $options_xml = $xml->createElement( 'Options' );
                                       $option_xml  = $xml->createElement( 'Option' );
                                           $this->xml_append( $option_xml, 'Name', 'Why' );
                                           $this->xml_append( $option_xml, 'Value', wp_strip_all_tags( $sashSideOne) );
                                       $options_xml->appendChild( $option_xml );
                                   $item_xml->appendChild( $options_xml );
                               }
                           }
       ```
   
 * However, the problem is that when the plugin is updated, it overwrites my code.
   Is there another way to do this – maybe a hook, other than the custom field. 
   The custom field hook does not work because this isn’t a custom field. It’s being
   mapped to the Product Options in ShipStation. The plugin already maps some product
   options, but in this case, it doesn’t because of it being a third-party plugin
   that creates these options in WooCommerce.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-shipstation-order-information-fields%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Michael K](https://wordpress.org/support/users/mikkamp/)
 * (@mikkamp)
 * Automattic Happiness Engineer
 * [7 years, 1 month ago](https://wordpress.org/support/topic/using-shipstation-order-information-fields/#post-11532840)
 * Hi,
 * There isn’t a hook available for adding additional XML data to the export. However
   you can use the custom fields to add additional information. If you want to return
   something different then the meta data you will need to use two filters to enable
   the field and return a custom value. You can do that with a code snippet something
   like this:
 *     ```
       add_filter( 'woocommerce_shipstation_export_custom_field_2', '__return_true' );
   
       add_filter( 'woocommerce_shipstation_export_custom_field_2_value', 'woo_shipstation_custom_field_2_value', 10, 2 );
       function woo_shipstation_custom_field_2_value( $value, $order_id ) {
       	$order = wc_get_order( $order_id );
       	if ( $order ) {
       		// Return some data here for the custom field
       		return $order->get_order_number();
       	}
       	return $value;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Using Shipstation Order Information Fields’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-shipstation-integration/assets/icon-256x256.
   png?rev=3234406)
 * [ShipStation for WooCommerce](https://wordpress.org/plugins/woocommerce-shipstation-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-shipstation-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-shipstation-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-shipstation-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-shipstation-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-shipstation-integration/reviews/)

## Tags

 * [shipstation](https://wordpress.org/support/topic-tag/shipstation/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael K](https://wordpress.org/support/users/mikkamp/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/using-shipstation-order-information-fields/#post-11532840)
 * Status: resolved