ResolvedPHP Fatal error: Uncaught Error: Call to a member function get_id() on null in

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #20630
    andy
    Participant

    I created a simple product. When I click on Order Now in product search or wherever I get this error:

    AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_id() on null in /var/www/vhosts/dev.interpid.eu/spizzati.dev.interpid.eu/wp-content/themes/lafka/woocommerce/content-single-product-lafka-quickview.php:65\nStack trace:\n#0 /var/www/vhosts/dev.interpid.eu/spizzati.dev.interpid.eu/wp-content/plugins/woocommerce/includes/wc-core-functions.php(249): include()\n#1 /var/www/vhosts/dev.interpid.eu/spizzati.dev.interpid.eu/wp-content/themes/lafka/incl/woocommerce-functions.php(787): wc_get_template('content-single-...')\n#2 /var/www/vhosts/dev.interpid.eu/spizzati.dev.interpid.eu/wp-includes/class-wp-hook.php(288): lafka_quickview('')\n#3 /var/www/vhosts/dev.interpid.eu/spizzati.dev.interpid.eu/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('', Array)\n#4 /var/www/vhosts/dev.interpid.eu/spizzati.dev.interpid.eu/wp-includes/plugin.php(478): WP_Hook->do_action(Array)\n#5 /var/www/vhosts/dev.interpid.eu/spizzati.dev.interpid.eu/wp-admin/admin-ajax.php(175): do_action('wp_ajax_lafka_q....\n', referer: http://spizzati.dev.interpid.eu/product-category/speisen/dessert/

    #20633
    Althemist
    Keymaster

    Hello andy,

    Please, give us a link to your site, where we can see th problem “live”, so we can further investigate this for you.

    Regards,
    Dimitar

    #20650
    andy
    Participant
    This reply has been marked as private.
    #20651
    andy
    Participant
    This reply has been marked as private.
    #20673
    Althemist
    Keymaster

    Hello andy,

    So sorry for the late reply. We had some internal problems here.

    We have just checked your site and the problem is that your product doesn’t have an image. The quick view is looking for it and thus generates an error. Could you, please check if everything is OK when you attach a product image?

    Regards,
    Dimitar

    #20708
    andy
    Participant

    Yes, if there is an image it works well. Is there a quick workaround to solve this? We use a “default” image for all products that don’t have specified an image, as we don’t attach images to all products.

    #20727
    Althemist
    Keymaster

    You’d need to manually assign a default image to those products. The one I saw on your website is just a placeholder. It’s not really assigned to the product and that’s the reason for the error.

    Regards,
    Dimitar

    #20751
    andy
    Participant

    I understand the issue but your solution is not good.

    It’s about a FATAL Error which is coming from the code from the theme, so it should be fixed in the theme.
    We will use the placeholder for images, we don’t have images for all our products.

    Please provide a technical workaround/solution.

    #20755
    andy
    Participant

    just use $product instead of $post and the problem is solved. $post on this page is probably a bug.
    Very, very low quality support on this one.

    #20756
    andy
    Participant

    echo apply_filters(‘woocommerce_single_product_image_html’, sprintf(‘%s‘, wc_placeholder_img_src(), esc_html__(‘Placeholder’, ‘lafka’)), $product->get_id());

    #20775
    Althemist
    Keymaster

    Hello andy,

    I am really sorry about your disappointment and frustration. I’ll ask our lead developer Alex to step in and explain.

    Meanwhile, we have a plan to introduce additional products layout, where users would be able to list products without any image (be it placeholder or not) – just as a list.

    Regards,
    Dimitar

    #20790
    Alex
    Keymaster

    Hello andy,

    I am looking on the issue, will let you know for the outcome soon.

    Regards,
    Alex

    #20794
    Alex
    Keymaster

    Hello andy,

    Thanks for your patience and for reporting the bug.

    You are absolutely right, somehow we’ve left this ‘$post’ on the wrong place. Changing it to $product fixes the bug.

    It is fixed now in the codebase.

    We will release the update today.

    Regards,
    Alex

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

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register
IMPORTANT!!!

Hello everybody! Please, accept our sincere appologies for the delaeyd support last 2 weeks. One of our team members was diagnosed with Covid-19 and we were isolated without the chance to leave home or access our office. We are now back to work and slowly catching up with delayed support tickets. We expect the queue to be cleared and everything to be back to normal schedule by Monday, 29th of June.

Thank you so much for your patience and understanding.

Best regards,
Althemist team
close-link