Skip to content

Instantly share code, notes, and snippets.

@lukecav
Created August 7, 2019 19:42
Show Gist options
  • Select an option

  • Save lukecav/78b68bb1f46168963adfe659303a3fa6 to your computer and use it in GitHub Desktop.

Select an option

Save lukecav/78b68bb1f46168963adfe659303a3fa6 to your computer and use it in GitHub Desktop.

Revisions

  1. lukecav created this gist Aug 7, 2019.
    7 changes: 7 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    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;
    }