Add Suffix or prefix to woocommerce order ID?

Add this line to either to functions.php or to your custom functions.

add_filter( ‘woocommerce_order_number’, ‘change_woocommerce_order_number’ );

function change_woocommerce_order_number( $order_id ) {
$prefix = ‘YourCustomPrefix-‘;
/* $suffix = ‘/SFX’; */
$new_order_id = $prefix . $order_id ;
return $new_order_id;
}

Leave a Reply