Blog

WooCommerce Sequential Order Numbers

Update 5/25/2012 – While this free version of the plugin will always remain available, I now offer an officially supported “Pro” version which can be purchased from the WooCommerce shop: Sequential Order Numbers Pro. The Pro version has additional features including: start the order numbers at any particular number, set a custom number prefix/suffix with date pattern substitutions, set an order number length, exclude free orders from the order number sequence, and more. The Pro version is fully compatible with the free version, so if you are current free user, or want to test it out, you can always upgrade to the Pro.

With the recent release of WooCommerce 1.5.3 and a convenient new filter called woocommerce_order_number it’s now possible to extend WooCommerce to support incrementing order numbers. This article describes the approach taken for my WooCommerce Sequential Order Numbers plugin.

Implementation

WooCommerce order records are stored in the WordPress posts table, and the post id is used as the order number. This is a very simple and natural implementation, but it also means that as blog posts and pages are added to a site the order numbers will jump up correspondingly. Your very first order could easily have an order number in the hundreds. Granted, this is merely a cosmetic issue, and one that only a site operator would notice, but still some owners prefer to have sequential order numbers.

The solution I settled upon was to add a new post meta record, which I named _order_number to hold a sequential order number independent of the post id. I set this order number with a hook on the core wp_insert_post action which is called on every post insert, like so:

if ( $post->post_type == 'shop_order' ) {

  $order_number = get_post_meta( $post_id, '_order_number', true );

  if ( $order_number == "" ) {

    // attempt the query up to 3 times for a much higher success rate if it fails (due to Deadlock)

    $success = false;

    for ( $i = 0; $i < 3 && ! $success; $i++ ) {

      // this seems to me like the safest way to avoid order number clashes
      $success = $wpdb->query($wpdb->prepare('INSERT INTO '.$wpdb->postmeta.' (post_id,meta_key,meta_value) SELECT '.$post_id.',"_order_number",if(max(cast(meta_value as UNSIGNED)) is null,1,max(cast(meta_value as UNSIGNED))+1) from '.$wpdb->postmeta.' where meta_key="_order_number"'));

    }

  }

}

I decided to set the order number equal to the largest existing order number + 1, in one query, in order to try and avoid two simultaneous orders being assigned the same number (called a “clash”). The one risk is that two simultaneous orders will cause a deadlock and neither will be assigned an order number, which would be annoying but not necessarily the end of the world, it could be easily fixed by manually assigning an order number in the database if need be. In a test I performed of 20,000 orders inserted two at a time as quickly as possible, I had a failure rate of .39%, so I don’t think this should be a concern for the average store, though don’t get mad at me if you encounter it, you have been warned.

The other important piece of code is the function attached to the new woocommerce_order_number filter, which actually returns the sequential order number. This function looks like the following:

function get_order_number( $order_number, $order ) {

  if ( isset($order->order_custom_fields['_order_number'] ) ) {

    return '#'.$order->order_custom_fields['_order_number'][0];

  }

  return $order_number;
}

That’s pretty much it for the interesting code, and handles the custom order number everywhere on the frontend of the website, along with the HTML emails. Displaying the custom order number in the admin required overriding a bit more functionality than I would have liked, but if the new order_number() function which is used in the frontend is added to the admin in a future WooCommerce release I’ll be able to simplify this plugin quite a bit.

Installation

When this plugin is installed, any existing orders are assigned their current id as their custom order number. This means that if the most recent order is #501, the next order placed after the installation of this plugin will be #502, and from then on the numbers will be sequential. If this plugin is installed prior to any orders being placed, the first order number will be #1.

To install, go to Plugins > Add New, in your WordPress admin, and search for ‘WooCommerce Sequential Order Numbers’, or download from the WordPress.org plugin page.

83 Comments

  • Dave 4 months ago Reply

    Thanks for this plugin… I just tested it out and while the order shows up in the back end and in the email that goes to the buyer as Order: #1, the email that goes to the seller still has the incorrect order number in the subject line of the email. Any way to fix this?

    • justin 4 months ago Reply

      Hey, thanks for giving the plugin a try and leaving the feedback. I did notice that the subject line is incorrect in that email and I have it on my to-do list to look into. The new filter that makes the custom order numbers possible isn’t used on that subject line, but hopefully I’ll be able to work around it. Thanks again

      • Dave 4 months ago Reply

        That’d be awesome Justin. This is great functionality if it can hit all those spots with the same order number.

        • justin 4 months ago Reply

          Cool, hope it’s helpful for you. I should add that I heard the core WooCommerce team may be creating some sort of custom order number functionality of their own, but I needed this sooner so I figured I’d release it to the community as well. When the core team does their version I’ll describe and link to it from here.

          • Dave 4 months ago

            I do love it, this issue is pretty much the only thing that I wasn’t liking about WooCommerce as I built my first WC site, and you should really be commended for doing the work and releasing this plugin. But unfortunately I just can’t use it in its current form unless the numbers line up — It would confuse my client too much. I’ll watch this space and/or my PlugIns page to see if you get a chance to release an update at some point.

          • justin 4 months ago

            This should now be fixed with the 1.1.1 release

  • Dave 4 months ago Reply

    Also, I should add the incorrect number shows up on the Order Received page. Just noticed this.

    • Dave 4 months ago Reply

      OK with Justin’s help I was able to fix this issue on the Order Received page… he asked me to describe the fix so here goes. Keep in mind I’m not a developer so hope I describe it in a way that makes sense.

      The problem comes from having customized a template in /plugins/woocommerce/templates/checkout/thankyou.php by copying it to my-theme/woocommerce/checkout/thankyou.php, which is the Woo-recommended way of customizing. Woo then released an update for WooCommerce, 1.5.3, but the template I had copied was from before 1.5.3 and line 37 of thankyou.php had changed:

      Prior to 1.5.3:

      37: $order->id;

      After update to 1.5.3:

      37: $order->get_order_number();

      Apparently Justin’s plugin makes use of that updated 1.5.3 line. So if you had done what I did, just replace that line, or probably better, replace the customized template altogether with the fresh 1.5.3 one and recustomize, and then the order numbers will correspond in the WP back end, the body of the customer email, and in the body of the email that goes to the seller.

      Now if we can get the number in the subject line of the email to the seller to correspond with all those, it’d be perfect. I didn’t customize that template so not sure what’s going on there.

      • Dave 4 months ago Reply

        Looks like version 1.1.1 of the plugin clears up the numbering in the back-end/customer email/seller email. Working great. Nice work, Justin.

  • Arvind 4 months ago Reply

    Justin, thanks for this wonderful plugin! In our case, we would like to start the order numbers from a pre-defined number (let’s say Order No. 5000). This is very important for us since we had a old site where there are leftover orders and we need to continue from there. How can we do this now? Is there an option in the plugin or can we change something in the database?

    • justin 4 months ago Reply

      Hey Arvind, thanks for trying out the plugin, and for the question. I don’t have a way to configure this from within the plugin yet, it’s on my todo list, but I haven’t had a chance to get to it due to client projects. For the moment though, if you really want that specific order number and don’t mind a slightly (temporarily) hacky solution and feel comfortable connecting to your database and running some queries, you can run the following for instance to start orders at 5000:

      insert into wp_postmeta (post_id,meta_key,meta_value) values (0,’_order_number’,4999);

      Then, sometime after your first real order is placed, just go back in there and delete the dummy record. Hope this helps, let me know if you have any other troubles.

    • justin 4 months ago Reply

      Hey Arvind, if you’re still looking for this functionality built-in, it’s now available (along with the custom prefix/suffix feature) in the newly released Pro version of the plugin: http://zfer.us/lh1Jh?d=http://www.woothemes.com/extension/sequential-order-numbers-pro/

      • Arvind 4 months ago Reply

        Thanks a lot, Justin. We will be buying your pro version next week. We are currently sorting out the issues in two payment gateways (Skrill and CCAvenue) that uses the post_id order number.

        • justin 4 months ago Reply

          You’re very welcome Arvind. Now, with the Skrill and CCAvenue gateways, have you gotten in touch with the Patrick Garman for Skrill and mRova for CCAvenue, to ask them to update their plugins to use the order number function, rather than the post_id directly? That way the gateways will be compatible not just with my plugin, but any WooCommerce plugins that alter the order numbers.

  • Paul 4 months ago Reply

    Hi,

    Would it be possible to enable your plugin to add a prefix “ABC” to the order number stored in the db?

    Or is there an easy what to do this?…

    I can add it like this..

    add_filter( ‘woocommerce_order_number’, ‘custom_woocommerce_order_number’, 1, 2 );

    function custom_woocommerce_order_number( $oldnumber, $order ) {

    return ‘CUSTOMPREFIX’ . $order->id;

    }

    But that doesn’t add it to the db

    Thanks!

    • justin 4 months ago Reply

      Hey Paul, it would definitely be possible to modify the plugin to allow for prefixes/postfixes to the custom order number, however as you saw, adding a simple filter won’t do the trick if you want to store the number in the database. The safest way to accomplish that might be to modify the plugin to add a new post meta field: one to hold the incrementing order number, and the other to hold the formatted order number. For some people, simply adding the filter to display it on the frontend could be the best solution, it all depends on what you’re trying to achieve.

      • Paul 4 months ago Reply

        Hi Justin, thanks for your reply.

        Yeah my client is pretty adamant about having a company specific prefix in front of all the order numbers..

        Although the filter works I feel it would be safer to just have it stored with the prefix so I don’t have to worry about whether it will appear or not on all customer viewable pages/email etc…

        So can we expect to see this feature added on the new version of your plugin? :-)

        • justin 4 months ago Reply

          Ha ha, well I have added it to my internal feature request tracker for this plugin. The main issue is just one of time: I have so much work to be done for my own clients/customers, and only so much time for the free plugin work I’m afraid. I’m sure I’ll add it at some point, I just couldn’t really guarantee when. Sorry about that, I can certainly let you know if/when I add this feature. Best of luck!

          • Paul 4 months ago

            I hear ya :-) … Many thanks for you replies!!

    • justin 4 months ago Reply

      Hey Paul, good news if you’re still looking for this functionality: it’s now available in my new ‘Pro’ version of the plugin, which was just released yesterday: http://zfer.us/lh1Jh?d=http://www.woothemes.com/extension/sequential-order-numbers-pro/

      • Paul 4 months ago Reply

        WooHoo … brilliant!! .. perfect timing too :-) Thanks Justin!!!

        • justin 4 months ago Reply

          :) You’re very welcome, hope you like it!

  • Peter 4 months ago Reply

    Hi

    This doesn’t work with the Print Invoice Extension. Mike Jolley said he was going to contact you about this.

  • Ka Yue 4 months ago Reply

    Could you please push your code to Github so we can contribute? Thanks

    • justin 4 months ago Reply

      Hey Ka, thanks for the suggestion. There will be some exciting changes coming soon to the Sequential Order Number plugin, as it will become an approved WooCommerce plugin available at the WooThemes site. Woo! Is there any specific functionality you would like to see added to the current free WordPress-hosted plugin?

  • Ka Yue 4 months ago Reply

    I think you should remove the # sign in the get_order_number() method.

    • justin 4 months ago Reply

      Yeah, I always thought it was sort of odd as well, but in keeping with the core functionality, which does say “Gets the order number for display”, I guess it makes sense.

  • Arvind 4 months ago Reply

    Hi Justin,

    We see when the order number gets passed to the payment gateway it always seem to be the older order number not the one generated by the sequential order number.

    Also, if someone creates a new plugin that uses order number, is there an assurance that it will automatically uses the order number generated by “sequential order number” plugin?

    If the above two can be incorporated, this will be a great plugin to use.

    Thanks,

    • justin 4 months ago Reply

      Hey Arvind, well it all comes down to how the particular payment gateway or other plugin is written. For your payment gateway the underlying post id is being passed, rather than the value returned by the get_order_number() function. This function has only been around for a couple of WooCommerce releases, so it’s up to the individual plugin authors to get in the habit of calling that function rather than using the underlying post id directly, but the good news is that even any existing plugin can be easily modified to use the custom order number properly.

  • Sharon 4 months ago Reply

    I am currently using the free version of your plugin before I purchase it.

    I am having the issue mentioned above whereby the order number is sequentially correct in my list of “orders” and also in the “New Customer Email” that I receive. But for payment gateway I am using the visser off-line credit card plugin and when I get the second email with the rest of the cc info, “Payment Details,” that email has the incorrect order number on it.

    Is there some coding I can add to fix this or is it fixed in the free or paid version of your plugin? Thanks!

    • justin 4 months ago Reply

      Hey Sharon, thanks for trying out my plugin, and for the question. Which payment gateway are you using? This is simply an issue with payment gateways that were written before WooCommerce added the ability to modify order numbers, which my Sequential Order Number plugin takes advantage of. I’m slowly working with WooCommerce and the various gateway plugin authors to get their plugins compatible with the custom order numbers. It’s not a difficult thing to do, just requires that they make a couple of small changes to their plugins and then everything works correctly.

  • Paulien 4 months ago Reply

    Hi Justin

    I’m using the free version now and thinking about buying the pro version. Great plug in! But have the same problem as Sharon and Arvind above. The numbers parsed to the payment provider seems to be the old number. Is there any news on this already? I’m using the plug in from Sisow: https://www.sisow.nl/algemeen/implementatie

    It would be great if this problem could be fixed

    • justin 4 months ago Reply

      Hey Paullen, thanks for trying out my plugin and for stopping by. Basically the Sisow plugin would need to be updated to support WooCommerce custom order numbers. The most ideal solution would be if you could get in touch with Sisow and get them to make the couple of simple changes which I outline here in the documentation: http://wcdocs.woothemes.com/user-guide/extensions/functionality/sequential-order-numbers/#add-compatibility I took a quick look at the Sisow code and it looks like it would be a pretty simple matter to make the fix so I could supply you with a modified version of their plugin, I just would have no way of testing it myself, and of course if they later update theirs and you upgraded you’d lose the changes. Hope this makes sense, let me know if you need anything further. Thanks!

      • Paulien 3 months ago Reply

        HI Justin, Sisow fixed it! It works now. I also bought the paid version. It works fine. Thanks

        • justin 3 months ago Reply

          Hey that’s great news, glad to hear Sisow was willing to oblige you and make their gateway compatible. Thanks also for picking up the paid version, I really appreciate it, and I hope it works out well for you!

  • keeperman 3 months ago Reply

    hi,

    May I ask how to reset order number,and what is the Max order? it’s unlimited?

    thank you very much

    • justin 3 months ago Reply

      Hey, although there isn’t a direct ‘reset order number’ feature, you can effectively do this by deleting all orders, and then removing them all from the trash (completely deleting them is a two-step process). No limit on order number (well that’s not completely true, there is a machine limit, but its so ridiculously huge, don’t worry about it)

  • Davide 3 months ago Reply

    Hi Justin,

    I’m using your fundamental plugin.

    While it works for every other case, it doesn’t seem to work at all with PayPal basic Payment Method: in PayPal e-mail as Commercial Invoice ID I still get the WP post ID rather than the sequential order ID.

    Should I change something or add some code?

    Thanks

    • justin 3 months ago Reply

      Hey Davide, thanks for pointing this out, I actually had never used the PayPal standard payment gateway, so I had no idea it was not using the custom order numbers. I took a look through the code, and it’s not necessarily a straightforward change, because WooCommerce automatically prepends ‘WC-’ to the invoice number, unless you change the “Invoice Prefix” to something else, so I’m not really sure how best to handle that especially with my paid plugin which also allows you to set an order number prefix. Would I have the PayPal invoice be: PayPal Invoice Prefix + Order Number Prefix + Order Number + Order Number Suffix? What I’ll do is try and change the paypal gateway so it works with my order number plugins, and submit the changes for inclusion within WooCommerce.

    • justin 3 months ago Reply

      I have patched the paypal standard gateway for the current version of WooCommerce (1.6.5.2) and have it available for download here: class-wc-paypal.zip. You can try it out by using it to replace the one found at woocommerce/classes/gateways/paypal/class-wc-paypal.php. I'm going to submit the change to WooCommerce and try to get it included in the next release. Let me know if you have any problems with the new version if you try it out, and thanks again for bringing this to my attention.

      • Davide 3 months ago Reply

        Hi Justin

        thank you very much for the immediate support.

        I hope it will be included in next WC release.

      • skip 3 months ago Reply

        will this patch work if i am using the free plugin or is it just for the paid version? thanks!

        • justin 3 months ago Reply

          Hey Skip, it will work for either one, or indeed any plugin that provides custom order numbers.

          • skip 3 months ago

            thanks for the prompt response. after replacing paypal gateway php file with the one you have above we had customers report that once they clicked on “place order” they were taken to the paypal screen but it said that payment had already been processed for that invoice number… any ideas?

          • justin 3 months ago

            Hey skip, yeah, it means exactly what it says, that the invoice number that got sent with the payment request had already been used. You need to make sure to use either some incrementing number that hasn’t been used, or some combination of prefix/suffix strings that makes the number new. Also, don’t forget that the paypal gateway will automatically add a ‘WC-’ prefix by default onto the invoice number, in addition to whatever you configure my order number plugin to create. This happens even if you configure the prefix in the paypal gateway to be empty… it’s kind of odd

      • Bruce 3 months ago Reply

        This plugin has really helped me out – thank you. My client has just come to me with this PayPal order number issue. Have you received anymore feedback on this patch? Do you know when it’s going to be officially released? Thanks

        • justin 3 months ago Reply

          Hey Bruce, hopefully it will be included in the next version of WooCommerce and while I’m not sure when that will be I’d guess it won’t be too long as there hasn’t been a release in more than a month. You can go ahead and try out the class-wc-paypal.zip patch with your client for now if you like.

  • Eran 3 months ago Reply

    Hi. I am using the simple plugin that you developed, it creates the orders in a sequential order but in the email it shows a different number.

    I use version 1.2.3

    Please advice.

    • justin 3 months ago Reply

      Hey Eran, thanks for giving my plugin a try. In case you haven’t already figured this one out, what you’re describing is most likely a case of an overridden template file. Specifically one or more of the “emails” templates. If you look in your theme, under “woocommerce/emails” you might see a bunch of files like admin-new-order.php, customer-completed-order.php, etc. If these files are present, and use $order->id rather than $order->get_order_number(), that’s your problem. Change all $order->id to $order->get_order_number() and you should be all set.

  • Paul 3 months ago Reply

    Hi Justin,

    I bought the pro version last week and it works like a charm.

    Just wanted to say thanks for a great plugin and for your (a;ways prompt) help here too…

    -Paul

    • justin 3 months ago Reply

      Hey Paul, you’re very welcome! Thanks so much for the plugin purchase, I appreciate it

  • Louis 3 months ago Reply

    Hi Justin,

    Long time no see.

    I have a couple of questions, the second one is not related to this page — hopefully you can help!

    1) I got the pro version — what would happen if at some stage I decided to change the order number prefix and suffix, would that be a problem?

    2) Do you know how to call (certain) product attributes via php — while keeping their hyperlinks?

    Thanks,

    Louis

    • justin 3 months ago Reply

      Hey Louis, thanks for picking up my sequential order numbers pro plugin, I appreciate it! you can definitely change the order number prefix/suffix, at which point any newly placed orders will have that suffix/prefix (older orders will not be changed). Not sure what you’re asking with the second question.

      • Louis 3 months ago Reply

        Hi Justin, regarding the other question — no worries.

        Back on topic (1) and the reason I asked; for example I might want to change the prefix/suffix just for Christmas, so then it would be easier to look through invoices with “Xmas” showing in the order or something alike. Of course I could search by date…but that’s not the point.

        I have another question if you don’t mind — I hope I won’t confuse you; what would be the easiest way to set a new order number monthly (manually of course), but what I am asking is how do you find out the highest number? Because according to the documentation you have to set the number higher than the “highest” order number (hope I am not confusing you) — I’ll give you a real life example;

        For the sake of “clean” book keeping and organising, I will change the number every month, to a “square” number. I.e; January will start with 14000, February will start with 15000 etc…

        As I understand you cannot go back to say, 12000, 11000 etc.

        Please let me know if I am unclear and/or if my head messed up (due to the weather)! :P

        • justin 3 months ago Reply

          Hey Louis, sorry for the delay in getting back to you, and you may have already figured this out on your own, but what you’re describing shouldn’t be an issue. The easiest way to find the highest order number is to go to the WooCommerce > Orders table, and the newest order should be at the top by default. If it isn’t, you can sort by the “Order” column to bring it to the top. Thus, if your current highest order is XMAS-14511-A, and you know that the incrementing portion is ’14511′ you can then go to WooCommerce > Settings and set the “Order Number Start” to ’15000′. Also, if you try and set a starting order number that’s lower than the current highest, you’ll get a warning message on that settings page that will tell you the current highest order number, so no matter what you do you really won’t hurt anything.

          • Louis 3 months ago

            Hi Justin, thanks for the explanation, no worries, I am still at the tweaking stage — I’d rather take my time and do it well. It might not even be ready for Xmas anyway…

            It’s a neat extension for the “neat guy in me” :P

            Count on me — I’ll be “abusing” it’s feature set!

            I have another question about SKU, in case you can help, I’ll start on a fresh box — this one is getting narrow :-)

  • Louis 3 months ago Reply

    Hi again Justin, this question is about SKU, in case you can help/advise…

    What’s the main purpose of SKU really, is it useful for downloadable products?

    Would you have any “real life” examples explaining how in can help in 2 words (or bit more…). ;)

    It’s just that it doesn’t do anything in the meta box really, and customers can’t even search via SKU. Then I think to myself — with your extension, I can really organise things properly by date, prefix/suffix etc… I am trying to avoid clutter. As I’ll make use of the space for more attributes/taxonomies on the product page. Thanks and no worries — this is not urgent.

    • justin 3 months ago Reply

      Hey Louis, well according to wikipedia, a SKU or stock-keeping unit “is a number or code used to identify each unique product or item for sale in a store or other business”. It’s really most useful for businesses with physical inventory to track and manage, and somewhat less useful for stores that deal with only virtual or digital goods. You’re correct that it doesn’t really serve a purpose in the meta box, and neither can customers search by it by default. WooCommerce gives you a couple of different options for dealing with it; you can disable the SKU entirely by going to WooCommerce > Settings > Catalog and unchecking “Enable the SKU field for products”. You can also just not set it for products if you don’t use it for some. For myself, I actually disabled that whole meta box on the frontend as I didn’t want the SKU, categories or tags displayed, and I used the following to do that: remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40, 2 );. Thanks for the question!

      • Louis 3 months ago Reply

        Hi Justin, thanks for the explanation — much appreciated.

        I think it would be more useful if customers could search by SKU.

        Thanks for the code as well, it’s always useful. In my case, I’ll need more attributes/taxonomies though so I won’t remove the meta box though. :P

        • justin 3 months ago Reply

          You’re very welcome Louis. Yeah, customers searching by SKU is something I’ve been meaning to post about for a while

  • Janek 3 months ago Reply

    Hi!

    I discovered today, thad i had sequential order numbers until 76. The suddenly 77 was missing and 78 was next. There was no orders in the trash, it just went to 78.

    So next thing i noticed that if you use on the backend Add order button it creates another number for order even when you`re not entering any orders.

    Now my question – is there a way to delete these blank orders from phpmyadmin so i could start with the correct order number again?

    Best regards!

    • justin 3 months ago Reply

      Hey Janek, well I’ll admit you have me pretty stumped with this one. I can see what you mean; if you click Add Order and then leave the page, a new post gets created with status “auto-draft”, and there’s no way to see it from the WordPress admin. You could certainly delete that record from the wp_posts table, but then there will be records left orphaned in other tables (ie wp_postmeta). Actually this may be a bug with my sequential order number plugin, thanks for letting me know about this. I’ll add it to my bug tracker and see if I can come up with a fix, and for now I guess I’d say try not to click ‘Add Order’ unless you’re really adding an order, or if you do, click “Save” before you leave that page, so that way you can later delete the order.

      Edit: actually, there is another way to recover and delete the invisible draft orders. You need to determine the post id for the invisible order. You can do this by hovering over the order before and after the missing one, so in your example if you hover over 76, you may see that the link is https://localhost/wp-admin/post.php?post=1904&action=edit while hovering over 78 the link might be https://localhost/wp-admin/post.php?post=1906&action=edit This would tell you that the id for the missing order is 1905, so you could go to the URL https://localhost/wp-admin/post.php?post=1904&action=edit, save the order so it’s no longer that hidden “draft” status, and then delete the order as normal.

      • Janek 3 months ago Reply

        Hi Justin,

        Thanks for your comment. Tried this solution with the links. What i discovered:

        Last order is with the number 76 but next is 78. So, the missing one is nr 77. I hovered over 76 and saw http://yoursite.com/wp-admin/post.php?post=2938&action=edit

        Next, i opened http://yoursite.com/wp-admin/post.php?post=2939&action=edit but discovered that it is one page i have published after last order with nr 77. It seems to me that this published page takes its place inside this Woocommerce order numbers. Basically, i cannot delete it because i need this page to be shown. And if in the future i`ll add any pages (or posts) then there will be probably the same problem with the numbers. Hopefully your next release will manage to avoid this ;)

        • justin 3 months ago Reply

          This is now fixed in the latest release of the plugin. Thanks again for reporting the original issue!

  • Jeff 2 months ago Reply

    Hey Justin,

    Can the prefix functionality of this plugin be used to remove the # from the orders? I have an automated telephone script tied to emails that can’t accept special characters, so I need to remove it.

    Thanks,

    Jeff

    • justin 2 months ago Reply

      Hey Jeff, this feature will be included in the next release of the pro version along with a couple of other improvements including improved compatibility with the Customer/Order CSV Export plugin, improved compatibility with the subscriptions plugin, and an improved upgrade experience from the free plugin. Thanks for the question!

  • Soniya 2 months ago Reply

    Justin, thanks for this wonderful plugin! However I still have a small issue. The email which goes to the admin for new order contains wrong order number. I am using the latest version of plugin. Can you please help me fix that. Thanks

    • justin 2 months ago Reply

      Hey Soniya, thanks for using our plugin, sorry you’re having the issue. Does your theme override the core email templates? The first thing is to try switching to Twenty Twelve and see whether the issue remains. See, Sequential Order Numbers depends entirely on other plugins/themes correctly calling the $order->get_order_number() method, if you take a look at the email templates which may be overridden in your theme, you’ll probably find $order->id being used instead of $order->get_order_number(). Hope this helps!

      • Soniya 2 months ago Reply

        Thank you Justin for the help. Perfect to find out the problem area. My Theme function was calling $order->id causing the issue. Fixed now.

        Thank you once again for the prompt help.

        Soniya

        • justin 2 months ago Reply

          I love hearing success stories!

          • Soniya 2 months ago

            Hi Justin, The plugin works perfectly with most of the payment methods, but I have problem with one of my payment gateways. I am using WooCommerce CCAvenue gateway. If I change $order->id to $order->get_order_number() I get an error ” Invalid Order”.

            There is just one instance of $order->id.

            On using original code for Woocommerce CC Avenue plugin, order gets completed but no information is returned on my site and so no database update with order, no email confirmation and no admin email is generated.

            I will be really grateful for help. thank you

            Soniya

          • Justin Stern 2 months ago

            Hmm, you’d really have to get in touch with the CCAvenue developers and ask them to add support for custom order numbers (if possible) as I’ve described in this section of the docs: http://docs.woothemes.com/document/sequential-order-numbers#add-compatibility Best of luck!

  • Sagar 2 months ago Reply

    I want woocommerce to generate a different order ID for every order, if the order fails and the customer returns back the same order ID is forwarded. I want every time a new order ID is generated. Could you please help me out?

    • Max Rice 2 months ago Reply

      Hi Sagar, WooCommerce will actually already do this if the customer leaves the checkout page and tries to place another order.

  • Mubashar 1 month ago Reply

    Hi there,

    I’ve tried this plugin. While it works with PayPal, other payment gateways are still getting the default ID and not the sequential one. I had a talk with the payment gateway guys and they said, its an issue with this plugin. Any help?

    Thanks

    • Beka Rice 29 weeks ago Reply

      Hi, can you tell us which payment gateway specifically that this was an issue with?

  • I want woocommerce that automatically generates the invoice after a certain period of time for that customer. I want to provide hosting services. Please help me

  • Tim 18 weeks ago Reply

    Hi!
    When I receive a payment, it’s still the old order ID it will show in my payment gateway info. It makes it kind of hard to find the right orders, when the order numbers don’t match.

    In the settings, for the payment module, there is this field, I think could be the solution:
    Payment Subject: Order: {order_id}
    The subject of the payment. {order_id} can be used as a placeholder for the order id.

    What should I change this to, in order to get the “real” order ID over?

    Thank you

  • James 12 weeks ago Reply

    The plugin is sending “old” ordernumbers to the paymentgateway DIBS FlexWin Payment Gateway

    Its listed to be compatible with your plug-in

    I ugently need a solution.

    Thanks.

Submit a Comment