1. Inicio
  2. Base de Conocimientos
  3. Precios mayoristas de WooCommerce Premium
  4. Backend
  5. Cómo Añadir Un Prefijo Personalizado al Número de Pedido para Pedidos de Mayorista

Cómo Añadir Un Prefijo Personalizado al Número de Pedido para Pedidos de Mayorista

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
¿Te ha resultado útil este artículo?

Artículos relacionados

¿Necesita soporte?

¿No encuentra la respuesta que busca?
Contactar con soporte
Completa tu Compra