Home Forums WoodMart support forum After reviewing the Thank You page, I noticed a discrepancy.

After reviewing the Thank You page, I noticed a discrepancy.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #666004

    pavel.vutkow
    Participant

    The displayed order number is incorrect — it’s showing the post ID instead of the actual order number, which should include a prefix. I’m using the official WooCommerce plugin to standardize order numbers.

    It seems that the page is calling $order->get_id() instead of $order->get_order_number().

    Can you help correct this so the proper (customized) order number is shown?

    https://snipboard.io/wqTkCi.jpg
    https://snipboard.io/A7ejda.jpg
    Regards,

    #666182

    Luke Nielsen
    Keymaster

    Hello,

    Is there any chance that you could give me access to the dashboard area so I can check the settings there?

    Looking forward to collaborating with you!

    Kind Regards

    #666294

    pavel.vutkow
    Participant

    Hi,

    Thank you – yes, but please keep in mind that this is the live site.
    Im the private mode I will sen dyou link.

    #666530

    Luke Nielsen
    Keymaster

    Hello,

    I have checked it and on my end it shows correctly, here are screenshots:

    Layout – https://prnt.sc/SxCOPue65HEz
    Default – https://prnt.sc/XVIsGcBGCpuA

    Let me know if you have sorted it out.

    Kind Regards

    #667534

    pavel.vutkow
    Participant

    Hi,

    I tested it again, and it took the ID. For now, I found a solution using a function..

    
    // Хелпер функция – взема поръчка от URL (?key=wc_order_...)
    function get_order_from_thank_you_page() {
        if ( ! isset($_GET['key']) ) return false;
    
        $order_key = sanitize_text_field( $_GET['key'] );
        $order_id = wc_get_order_id_by_order_key( $order_key );
        if ( ! $order_id ) return false;
    
        return wc_get_order( $order_id );
    }
    
    add_shortcode( 'customer_order_number', function() {
        $order = get_order_from_thank_you_page();
        if ( ! $order ) return '';
    
        return esc_html( $order->get_order_number() );
    });
    

    Are you planning to develop this page? Many options are missing now.

    To make it more customizable and meaningful, it would be nice to be able to display all the fields separately – price, customer name, phone, email…. etc. Otherwise, it becomes a bit meaningless and I have to insert my own code to make it look different from the classic one.

    #667682

    Luke Nielsen
    Keymaster

    Hello,

    Could you please send access to the staging site so I can disable that custom code there and check how it works?

    Looking forward to collaborating with you!

    Kind Regards

Viewing 6 posts - 1 through 6 (of 6 total)