• Hi guys,

    I have a plugin that helps me exporting the orders of our online-shop in a csv-file.
    However, it shows the original order-ID of WooCommerce instead of the sequential order numbers we use.
    At the moment the plugin uses this:
    $order->number = $order->ID;
    How can I change this to get the sequential order number?
    When I view the Meta Order Data, I found out that the name of the sequential order number field is: “_order_number”

    Please help!

    • This topic was modified 9 years, 1 month ago by ilke01.
Viewing 3 replies - 1 through 3 (of 3 total)
  • A WooCommerce order is a type of the post object. Posts are used for other things as well as orders, so you can’t directly edit order numbers.

    You’ll need a plugin to make a custom field and be able to use your own order numbers:
    https://wordpress.org/plugins/woocommerce-sequential-order-numbers/
    There are other similar plugins.

    Thread Starter ilke01

    (@ilke01)

    Hi lorro, thanks for the fast reply.

    I think I didn’t explain myself clearly.
    We already have a Plugin, that creates this custom field (Plugin is called “Sequential Order Numbers”). I think the meta key of this custom field is “_order_number”.
    However, the order export plugin we use, is not exporting this custom field, it only exports the ususal “random” WordPress number for the order (in the plugin editor it shows this: “$order->number = $order->ID;” to get it).

    I have zero knowledge of PHP. I guess I just need a simple request to pull that “_order_number” field instead of the order ID.

    • This reply was modified 9 years, 1 month ago by ilke01.
    • This reply was modified 9 years, 1 month ago by ilke01.
    Thread Starter ilke01

    (@ilke01)

    Solved it by myself. It’s simply “$order->number = $order->_order_number;”

    Thanks anyway!

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

The topic ‘Get sequential order number (php)’ is closed to new replies.