Created
August 7, 2019 19:42
-
-
Save lukecav/78b68bb1f46168963adfe659303a3fa6 to your computer and use it in GitHub Desktop.
Add in a custom prefix and suffix to WooCommerce Order Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number', 1, 2); | |
| function change_woocommerce_order_number( $order_id, $order ) { | |
| $prefix = '#SAM-'; | |
| $suffix = '-' . date(Y); | |
| return $prefix . $order->id . $suffix; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/38783349/adding-suffix-and-prefix-to-woocommerce-order-number-without-using-a-plugin