Custom Order Number
-
add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number' ); function change_woocommerce_order_number( $order_id ) { $prefix = 'PYXS/'; $suffix = '/44'; $new_order_id = $prefix . $order_id . $suffix; return $new_order_id; }
I am using the above snipped to add a prefix and suffix to my order number which seems to work OK however on issue it has created is that the custom code I added to display a tracking code in my order details template now doesn’t work because I assume it still wants the old order id minus the prefix & suffix.
$tracking_number = get_post_meta($order->get_order_number(), 'linnworks_tracking_number', true);
Anyone suggest how I can modify this line to work?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom Order Number’ is closed to new replies.