Thread Starter
lyle
(@lyle)
adding this didnt seem to work.. anyone able to help on this one?
add_filter( 'woocommerce_shipstation_export_custom_field_2', 'shipstation_custom_field_2' );
function shipstation_custom_field_2() {
global $post;
$order = wc_get_order( $post->ID );
$items = $order->get_items();
foreach ( $order->get_items() as $item ) {
// Compatibility for woocommerce 3+
$order_item_id = version_compare( WC_VERSION, '3.0', '<' ) ? $item['product_id'] : $item->get_product_id();
}
}
Hi @lyle ,
I’m not quite sure what you mean, as the Order ID is already part of the interface.
You access that order ID via the woocommerce_shipstation_get_order_id filter:
return apply_filters( 'woocommerce_shipstation_get_order_id', absint( $order_id ) );
Hope that helps!