• Hello Support Team,

    I am using the Custom Order Numbers for WooCommerce plugin. I recently updated the plugin from version 1.13.0 to version 2.0.0 on June 24, 2026.

    Since the update, I have encountered an issue with orders created programmatically.Issue

    When an order is created using any programmatic method, such as:

    • WooCommerce REST API
    • wc_create_order()
    • Other programmatic order creation methods

    the custom order number is not being applied correctly.

    Instead, the WordPress/WooCommerce post ID is used as the order number in:

    • WooCommerce Admin
    • Order emails
    • Other places where the order number is displayed

    For example, orders created manually through the WooCommerce interface work as expected, but orders created programmatically continue to use the original WordPress Post ID instead of the configured custom order number.

    Testing Performed: To investigate the issue, I reverted the plugin back to version 1.13.0, and the problem does not occur there. I have also tested the newer plugin releases after version 1.13.0, including the latest version available as of today, and I consistently experience the same issue.

    Therefore, I currently need to keep using version 1.13.0 as a workaround.

    Expected Behavior: Orders created through the REST API or programmatically using functions such as wc_create_order() should receive and display the configured custom order number in the same way as manually created orders.

    Actual Behavior: Programmatically created orders use the WordPress/WooCommerce Post ID instead of the configured custom order number, particularly in the WooCommerce Admin and email notifications.

    Could you please investigate whether there was a change in the newer versions that affects programmatic order creation or the hook/filter used to generate custom order numbers?

    I would appreciate a fix or a recommended workaround that allows us to use the latest version of the plugin while retaining custom order numbers for programmatically created orders.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support anjitha21

    (@anjitha21)

    Hi @plugindevs

    Thank you for providing the detailed information.

    I tried to replicate the issue in my environment, but everything is working as expected.

    I have escalated the issue to our developers for further investigation.

    They will look into it and I will update you as soon as I receive any feedback from them.

    Plugin Support priyankajagtap

    (@priyankajagtap)

    Hi @plugindevs,

    Thank you for your patience while we investigated this further.

    Our development team has prepared a patch to address the issue with custom order numbers not being applied to programmatically created orders.

    Could you please download the patched “class-core.php” file from the link below:
    Patch: https://www.dropbox.com/scl/fi/tfseszrg95e71gtve593g/class-core.php?rlkey=tvofm0p1g7j150szu6j562bdk&st=c7jerqzf&dl=0

    Then replace the existing file at the following path:
    wp-content/plugins/custom-order-numbers-for-woocommerce/includes/class-core.php

    Before replacing the file, we recommend taking a backup of the existing “class-core.php” file.

    Once you have applied the patch, please test creating an order through the REST API or wc_create_order() and check whether the configured custom order number is now applied correctly in the WooCommerce Admin and order emails.

    Please let us know the results after testing and feel free to ask if you have any queries.

    Thread Starter Plugin Devs

    (@plugindevs)

    Hi,

    Thank you for providing the patch. I’ll test it and confirm the results.

    Before applying it to production, could you please let me know when you expect this fix to be included in an official release of the plugin?

    Since the patched class-core.php file would be overwritten whenever the plugin is updated, I would prefer to have the fix merged into the core plugin rather than maintaining a modified plugin file manually.

    Also, since this issue affects programmatically created WooCommerce orders in general (e.g. REST API, wc_create_order(), etc.), it seems like a broader plugin compatibility issue rather than something specific to my implementation. Including the fix in an official release would therefore also help other users experiencing the same problem.

    Could you please let me know if this patch is planned for the next release, or provide an estimated timeline for when it will be officially included?

    Thank you!

    Plugin Support anjitha21

    (@anjitha21)

    Hi @plugindevs

    We have not finalized the release date for the next update yet.

    However, I can confirm that the patch will be included in the next official plugin release.

    Once the update is released, you will no longer need to maintain the patched class-core.php file manually.

    Thank you for your understanding and patience.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.