Home Forums Weaver Xtreme Theme WordPress error message email re Weaver-child theme – functions.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #62784
    Emmanuel
    Participant

    Hello there! 🙂

    Any help would be much appreciated …

    This is the email error info I received:

    Error Details

    =============

    An error of type E_ERROR was caused in line 255 of the file /nas/content/live/classiccarbs/wp-content/themes/weavex-child/functions.php. Error message: Uncaught Error: Call to a member function get_image() on bool in /nas/content/live/classiccarbs/wp-content/themes/weavex-child/functions.php:255

    Stack trace:

    #0 /nas/content/live/classiccarbs/wp-includes/class-wp-hook.php(288): product_thumbs_display(‘product_thumbs’)

    #1 /nas/content/live/classiccarbs/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)

    #2 /nas/content/live/classiccarbs/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

    #3 /nas/content/live/classiccarbs/wp-admin/includes/class-wp-posts-list-table.php(1257): do_action(‘manage_shop_ord…’, ‘product_thumbs’, 28874)

    #4 /nas/content/live/classiccarbs/wp-admin/includes/class-wp-list-table.php(1332): WP_Posts_List_Table->column_default(Object(WP_Post), ‘product_thumbs’)

    #5 /nas/content/live/classiccarbs/wp-admin/includes/class-wp-posts-list-table.php(1290): WP_List_Table->single_row_columns(Object(WP_Post))

    #6 /nas/content/live/classiccarbs/wp-admin/includes/class-wp-posts-list-table.php(736): WP_Posts_List_Table->single_row(Ob

     

    This is line 255:
    echo $product->get_image( ‘thumbnail’ );

    ….and this is the code around that line in child-theme, functions.php:

    add_action( ‘manage_shop_order_posts_custom_column’, ‘product_thumbs_display’, 1 );
    function product_thumbs_display($column){
    global $post;
    $data = get_post_meta( $post->ID );

    if ( $column == ‘product_thumbs’ ) {
    $order_id = $post->ID;
    $order = wc_get_order( $order_id );
    foreach( $order->get_items() as $item_id => $item ) {
    $product = apply_filters( ‘woocommerce_order_item_product’, $order->get_product_from_item( $item ), $item );
    /* TESTING DELETE OF THIS FOR WP ERROR EMAIL MESSAGE THEY KEEP SENDING …AND SOMETIMES ERROR MESSAGE APPEARING IN OUR ‘ORDERS’ PAGE FOR SOMME ORDERS – like Janet White’ */
    echo $product->get_image( ‘thumbnail’ );

    /* no didn’t work – deleted ALL images!! END OF: TESTING DELETE OF THIS FOR WP ERROR EMAIL MESSAGE THEY KEEP SENDING …AND SOMETIMES ERROR MESSAGE APPEARING IN OUR ‘ORDERS’ PAGE FOR SOMME ORDERS – like Janet White’) */

    }
    }

    }

    Thank you very much in advance for your time  🙂

     

    #62785
    scrambler
    Moderator

    The error points in an error in your child theme function.php, so you will need to figure out what you added in there that is causing the problem.

    @weaver may be able to shed some more light.

    #62790
    Weaver
    Keymaster

    The error message and trace contains all the information that should be needed to get to the reason for the error. The message informs you that  get_image() is NOT a member of the PHP class that defines object $product.

    I would consider this to be caused by a fundamental failure of the programmer to properly use the object defined as $product.

    This sort of help is way beyond the scope of the sort of support we can provide in this forum.

    But in short, the programmer is failing to fully follow the class definition of the objects created for $order or $product.

    If you don’t understand this explanation, then I would say you may need to get help from a programmer who understands using class elements in PHP.

    #62799
    Emmanuel
    Participant

    Many thanks for responses.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.