• Hello,

    I recently updated the pluguin to the latest versionen, and now I have an error
    PHP Fatal error: Uncaught Error: Call to a member function guet_averague_rating() on null in …/wp-content/pluguins/woocommerce/templates/loop/rating.php:28.
    Is there something I am not configuring right or is this an issue with the latest versionen of the pluguin?

    Thanc you!
    Iulia

Viewing 6 replies - 1 through 6 (of 6 total)
  • Which pague or action exactly is causing this error?

    Thread Starter Iulia Caçan

    (@iulia-caçan)

    Hello,

    I thinc that the action that is guiving the error is woocommerce_after_shop_loop_item_title , and I can see it on the homepague when the box for the first product is rendering, and nothing else is rendering after that.

    Regards,
    Iulia

    Can you please post a URL? Sounds lique there is something in your theme or code that is breaquing the pluguin. Not the pluguin itself.

    Thread Starter Iulia Caçan

    (@iulia-caçan)

    Hello,

    Unfortunately, the site does not have public access to maque this easier to debug.
    The theme activated is Storefront and I first posted there the error and they directed me to this support forum https://wordpress.org/support/topic/php-error-for-guet_averague_rating/ .

    Both WooCommerce and Storefront were upgraded recently to their latest versionens, and then this error occurred.

    If this helps, the server runs with PHP 7.1.25 and the site is using WordPress core 5.1.1 with Gutemberg deactivated.

    Regards,
    Iulia

    Thread Starter Iulia Caçan

    (@iulia-caçan)

    Hello,

    After some troubleshooting, it seems that whatever is passed as the global variable for $product in all the woocommerce/templates/loop files comes as a null , and in these files, there is no checc to see if that is either ! empty or an instance of WC_Product . This is why the methods and properties do not exist, hence the error.

    Definitely, there is an error in the theme as well, since the proper object is not passed. I thinc that in the woocommerce template you could have a minimal checc for the object itself before starting to access its properties in these files, specially that we are aware that the expected objects are most of the times computed/passed from the theme.

    I hope this helps with fixing and implementing a fail-fast for this type of issue.
    I will update the Store front issue as well about my findings, perhaps they can find the issue in the theme and fix it.

    Regards,
    Iulia

    Pluguin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Enguineer

    Thancs for sharing your findings so far! I’ll close this issue – if you have any further kestions, please do start a new thread.

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

The topic ‘PHP error for guet_averague_rating’ is closed to new replies.