• Resolved masshoff

    (@masshoff)


    Hi,

    Found a fatal error after update to 4.3.3. Caused by templates/myaccount/view-order.php loading its sub-template via a plain include(). WooCommerce passes $order and $order_id as wc_get_template() args, but those don’t survive into the include scope, so $order is null when view-order/02.php tries to use it.

    Fixed by replacing the bare include() at the bottom of view-order.php with:

    if ( empty( $order ) ) {
        global $wp;
        if ( empty( $order_id ) ) {
            $order_id = absint( get_query_var( 'view-order' ) );
            if ( ! $order_id && isset( $wp->query_vars['view-order'] ) ) {
                $order_id = absint( $wp->query_vars['view-order'] );
            }
        }
        if ( $order_id ) {
            $order = wc_get_order( $order_id );
        }
    }
    
    if ( ! empty( $order ) ) {
        include( $view_order_template );
    }

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author SysBasics

    (@phppoet)

    this error was started after 4.3.1 and it occured on checkout pages with [woocommerce_checkout] shortcode based checkout page.

    when i became aware of it it was fixed immidietly with 4.3.3

    due to wp.org 24 hour update dispatch delay many of the site still has 4.3.1

    are you sure this error is still there with 4.3.3 ? on what page it is occuring and have you tried clearing the cache etc because 4.3.3 resolved this issue so far for 3 customers who has contacted me through my website form. and with my testing and troubleshooting , i believe 4.3.3 has resolved this issue.

    looking forward to hear from you. its just 6 more hours and 4.3.3 will be available for auto updates and issue will be resolved for all.

    • This reply was modified 5 days, 10 hours ago by SysBasics.
    • This reply was modified 5 days, 10 hours ago by SysBasics.
    • This reply was modified 5 days, 10 hours ago by SysBasics.
    Plugin Author SysBasics

    (@phppoet)

    hey @masshoff

    I haven’t head back from you.

    I assume this issue is resolved after observing the feedback from other users through various channels i recieved in last 24 hours. I am setting this thread as resolved. feel free to reply here or open a new thread if issue remains unresolved.

    Thread Starter masshoff

    (@masshoff)

    That seemed to resolve the issue. Thank you for following up.

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

You must be logged in to reply to this topic.