Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author SkyVerge

    (@skyverge)

    Hi robert147,

    The export plugin will need to use $order->get_order_number(). You could do something like this in the export plugin

    $order_id = get_the_ID();
    $order = wc_get_order( $order_id );
    $order_number = $order->get_order_number();

    Hope that helps!

    Cheers,

    Tamara

    Thread Starter robert147

    (@robert147)

    Wow, fast response. I’ll try your suggestion tomorrow and let you know if it worked or not.

    Thread Starter robert147

    (@robert147)

    It worked. Thanks a lot!!!

    Rob

    Hi Tamara,

    Will the above suggestion work regardless of whether sequential order number is installed or not?

    i.e. if it isn’t installed, will it just pull the standard order number, and if it is installed will it get the correct one?

    Basically I want to make sure a plugin will work both with and without sequential order numbers installed.

    Thanks

    Plugin Author SkyVerge

    (@skyverge)

    Hey shawaj,

    The code returns the standard order number when Sequential Order Numbers is not activated so it is the same, and recommended, way to get the order number in WooCommerce ??

    I posted a reply to the other thread as well: https://www.ads-software.com/support/topic/will-get_order_number-work-without-sequential-order-numbers?replies=2#post-6680997

    Cheers,

    Tamara

    Thanks! And sorry for double posting, just thought it made more sense to do it in a new thread rather than hijack this one.

    Plugin Author SkyVerge

    (@skyverge)

    @shawaj, no problem at all ?? It’s generally a good idea to open your own thread and reference another one if needed. -Tamara

    I will remember that for next time. Thanks for your speedy replies

    Sorry, but I have no idea of what to do with this :

    $order_id = get_the_ID();
     $order = wc_get_order( $order_id );
     $order_number = $order->get_order_number();

    Where do I modify this ?

    Thanks for help.

    Plugin Author SkyVerge

    (@skyverge)

    Hi Dunanshi,

    That code was provided as an example for a custom plugin. Where and how you use this code will depend on the plugin.

    If you’re having a specific issue with another plugin which is not using the sequential order number, please create a new support thread here.

    Thanks ??

    Tamara

    @skyverge
    Hi,
    I am in the same case than robert147, I think…
    I use woocommerce-sequential-order-numbers and woocommerce-simply-order-export
    In the csv file I do not want the post_ID but the sequential_ID.

    The code is here if you need to look at it –
    https://github.com/wp-plugins/woocommerce-simply-order-export

    You should be able to look through that and make changes based on advice above

    I have it
    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to retrieve the sequential number from the database’ is closed to new replies.