Custmizing Order Numbers
-
I need to customize order numbers in the format like (year-month-dayofthemonth-orderID), without using any additional plugin.
I have got a code and made changes to it with additional text like this:
add_filter( ‘woocommerce_order_number’, ‘custom_woocommerce_order_number’, 1, 2 );
function custom_woocommerce_order_number( $oldnumber, $order ) {
return ‘Hello-‘ . date(“Ymd”) . ‘-‘ . $order->id;
}This works fine, except that the date is set to current date, what I want is to set it to the date when the order is filled ensuring that once the order number is set, it wouldn’t be changed by the code.
Would someone help me in this?
Thanks,
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custmizing Order Numbers’ is closed to new replies.