Created
April 10, 2017 20:34
-
-
Save bekarice/a4ab34962b998cc389d94f6bda247dd9 to your computer and use it in GitHub Desktop.
Add WooCommerce Order number prefix
This file contains 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
<?php // only copy if needed | |
/** | |
* Adds a prefix to the existing WooCommerce order number. | |
* | |
* @param int $order_id the order ID | |
* @param \WC_Order $order the order object | |
* @return string the updated order number | |
*/ | |
function sv_wc_add_order_number_prefix( $order_id, $order ) { | |
return "SV-{$order_id}"; | |
} | |
add_filter( 'woocommerce_order_number', 'sv_wc_add_order_number_prefix' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment