Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created April 10, 2017 20:34
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Add WooCommerce Order number prefix
<?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