1. Home
  2. Knowledge Base
  3. WooCommerce Wholesale Prices Premium
  4. Backend
  5. How To Add A Custom Prefix Order Number For Wholesale Orders

How To Add A Custom Prefix Order Number For Wholesale Orders

When you received a wholesale order, you’ll notice that we have added a new column in the WooCommerce Order page. This will help you differentiate which order is from a wholesale customer.

Order Type Column

You may want to take this further by differentiating the Order Number for the Wholesale Orders as well. You can add the following snippet to your child theme’s function.php:

add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number' );
function change_woocommerce_order_number( $order_id ) {

    $prefix = 'WH-'; //The Prefix 
    $order_type = get_post_meta( $order_id, '_wwpp_order_type',true); //get Wholesale Order Type
   
     if ($order_type == 'wholesale') {
        $new_order_id = $prefix . $order_id;
        return $new_order_id;
    }
    
    return $order_id;
}

Here’s how it will looks like:

Custom Prefix on Order Number of a Wholesale Order
Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support