Support » Plugin: WooCommerce » Custom order number not saved to database

  • I am using this gist to customize order number

    add_filter( ‘woocommerce_order_number’, ‘custom_woocommerce_order_number’, 1, 2 );

    function custom_woocommerce_order_number( $oldnumber, $order ) {
    return ‘CUSTOMPREFIX’ . $order->id;

    problem is, i make the prefix dynamic by generating 5 digit unique numbers.
    and everytime order page is loaded, these 5 digit keeps changing.
    it turns out that these 5 digits also not added to database eventhough it is sent to email!

    anyone can help?

  • The topic ‘Custom order number not saved to database’ is closed to new replies.