• Resolved mappil

    (@mappil)


    PHP Error function get_price() on bool

    2022/03/19 13:49:23 [error] 27075#27075: *1095409 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_price() on bool in /www//public/wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php:5427
    Stack trace:
    #0 /www//public/wp-includes/class-wp-hook.php(307): woo_feed_after_wc_product_structured_data(Array, Object(WC_Product_Variable))
    #1 /www//public/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array)
    #2 /www//public/wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php(3659): apply_filters('woo_feed_after_...', Array, Object(WC_Product_Variable))
    #3 /www//public/wp-includes/class-wp-hook.php(307): woo_feed_filter_woocommerce_structured_data_product(Array, Object(WC_Product_Variable))
    #4 /www//public/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array)
    #5 /www//public/wp-content/plugins/woocommerce/includes/class-wc-structured-data.php(328): apply_filters('woocommerc" while reading response header from upstream, client: 66.249.64.39, server: www..it, request: "GET /product/piumino-per-cani-nuvola/?attribute_pa_taglie=47 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7.4-fpm-.sock:", host: "www..it:58465"
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support ansarybadal

    (@ansarybadal)

    Hello @mappil

    Thanks for reaching us.

    The possible reason could be an incompatible plugin version which we need to check. Please, copy the status and paste it here.

    Regards,

    Thread Starter mappil

    (@mappil)

    Hello @ansarybadal,

    Status:
    https://pastebin.com/30kkMRrw
    Password: z2zcbd69EU

    Thank you

    Plugin Support ansarybadal

    (@ansarybadal)

    Hello @mappil

    Thanks for reaching us again.

    Sorry to say, the Pastebin URL you have provided couldn’t be accessed with the password or the password may have expired. Please, regenerate it and let us know.

    Or, you can directly reach us from here.

    Best regards,

    Thread Starter mappil

    (@mappil)

    We are having this problem too, and I believe it has only been happening in the last month, and possibly only since the last update. I can replicate the error by manipulating the URL to a product variation and alter the product attribute with one that doesn’t exist. For our needs (simple product feed), I don’t understand why the plugin is doing anything on product page load, but it is what it is.

    Example error from the logs:

    2022-03-17T00:31:34+00:00 CRITICAL Uncaught Error: Call to a member function get_price() on bool in /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php:5427
    Stack trace:
    #0 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/class-wp-hook.php(307): woo_feed_after_wc_product_structured_data()
    #1 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters()
    #2 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php(3659): apply_filters()
    #3 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/class-wp-hook.php(307): woo_feed_filter_woocommerce_structured_data_product()
    #4 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters()
    #5 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-content/plugins/woocommerce/includes/class-wc-structured-data.php(328): apply_filters()
    #6 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/class-wp-hook.php(307): WC_Structured_Data->generate_product_data()
    #7 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #8 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/plugin.php(474): WP_Hook->do_action()
    #9 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-content/themes/wass-theme-v3/woocommerce/content-single-product.php(90): do_action()
    #10 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/template.php(772): require('/home/654.cl...')
    #11 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template()
    #12 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-content/themes/wass-theme-v3/woocommerce/single-product.php(39): wc_get_template_part()
    #13 /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-includes/template-loader.php(106): include( in /home/654.cloudwaysapps.com/ppjnrwjvc/public_html/wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php on line 5427

    In your helper.php’s woo_feed_after_wc_product_structured_data function, you have no error checking to ensure that the $variation_id array contains a valid variation ID, so when wc_get_product is called with null, $variation_product is not a variation product object, leading to this error.

    Our specific problem is that we had a variation that changed attributes, so nothing is wrong with our variation, but Google still thinks the URL to that variation should exist. We could redirect to the new URL, but it seems the responsible thing for you to do to ensure that there are no fatal errors in this case.

    • This reply was modified 2 years, 8 months ago by skunkbad.
    Plugin Support ansarybadal

    (@ansarybadal)

    Hello @skunkbad @mappil

    A new version of our plugin has been released.
    Updating the plugin should solve the issue.

    Thank you,

    Plugin Support ansarybadal

    (@ansarybadal)

    Hello @mappil

    As we are not getting further replies, we assume you have found the solution.
    So, we are marking this issue as resolved.

    Please, feel free to start a new topic if you need any further assistance.

    Best regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PHP Error function get_price() on bool’ is closed to new replies.