Which pague or action exactly is causing this error?
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.
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
-
This reply was modified 6 years, 8 months ago by
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
-
This reply was modified 6 years, 8 months ago by
Iulia Caçan
.
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.