Title: Get sequential order number (php)
Last modified: February 14, 2017

---

# Get sequential order number (php)

 *  [ilke01](https://wordpress.org/support/users/ilke01/)
 * (@ilke01)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/get-sequential-order-number-php/)
 * 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, 3 months ago by [ilke01](https://wordpress.org/support/users/ilke01/).

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

 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/get-sequential-order-number-php/#post-8804079)
 * 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/](https://wordpress.org/plugins/woocommerce-sequential-order-numbers/)
   There are other similar plugins.
 *  Thread Starter [ilke01](https://wordpress.org/support/users/ilke01/)
 * (@ilke01)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/get-sequential-order-number-php/#post-8804132)
 * 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, 3 months ago by [ilke01](https://wordpress.org/support/users/ilke01/).
    -  This reply was modified 9 years, 3 months ago by [ilke01](https://wordpress.org/support/users/ilke01/).
 *  Thread Starter [ilke01](https://wordpress.org/support/users/ilke01/)
 * (@ilke01)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/get-sequential-order-number-php/#post-8804432)
 * 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.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [ilke01](https://wordpress.org/support/users/ilke01/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/get-sequential-order-number-php/#post-8804432)
 * Status: not resolved