Title: PHP Error function get_price() on bool
Last modified: March 19, 2022

---

# PHP Error function get_price() on bool

 *  Resolved [mappil](https://wordpress.org/support/users/mappil/)
 * (@mappil)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/)
 * 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](https://wordpress.org/support/users/ansarybadal/)
 * (@ansarybadal)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15478003)
 * Hello [@mappil](https://wordpress.org/support/users/mappil/)
 * Thanks for reaching us.
 * The possible reason could be an incompatible plugin version which we need to 
   check. Please, copy the [status](https://www.dropbox.com/s/8awe73f8hdmlny5/2022-03-21_10-30-39.png?dl=0)
   and paste it here.
 * Regards,
 *  Thread Starter [mappil](https://wordpress.org/support/users/mappil/)
 * (@mappil)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15478548)
 * Hello [@ansarybadal](https://wordpress.org/support/users/ansarybadal/),
 * Status:
    [https://pastebin.com/30kkMRrw](https://pastebin.com/30kkMRrw) Password:
   z2zcbd69EU
 * Thank you
 *  Plugin Support [ansarybadal](https://wordpress.org/support/users/ansarybadal/)
 * (@ansarybadal)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15486007)
 * Hello [@mappil](https://wordpress.org/support/users/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](http://webappick.com/contact).
 * Best regards,
 *  Thread Starter [mappil](https://wordpress.org/support/users/mappil/)
 * (@mappil)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15488370)
 * Hi [@ansarybadal](https://wordpress.org/support/users/ansarybadal/),
    new link
   [https://pastebin.com/J0imr599](https://pastebin.com/J0imr599)
 *  [skunkbad](https://wordpress.org/support/users/skunkbad/)
 * (@skunkbad)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15503349)
 * 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 4 years, 2 months ago by [skunkbad](https://wordpress.org/support/users/skunkbad/).
 *  Plugin Support [ansarybadal](https://wordpress.org/support/users/ansarybadal/)
 * (@ansarybadal)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15505439)
 * Hello [@skunkbad](https://wordpress.org/support/users/skunkbad/) [@mappil](https://wordpress.org/support/users/mappil/)
 * A new version of our plugin has been released.
    Updating the plugin should solve
   the issue.
 * Thank you,
 *  Plugin Support [ansarybadal](https://wordpress.org/support/users/ansarybadal/)
 * (@ansarybadal)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15588067)
 * Hello [@mappil](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/webappick-product-feed-for-woocommerce/assets/icon-256x256.
   gif?rev=3346213)
 * [Product Feed Manager for WooCommerce – CTX Feed – Support 220+ Shopping & Social Channels](https://wordpress.org/plugins/webappick-product-feed-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/webappick-product-feed-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/webappick-product-feed-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/webappick-product-feed-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/webappick-product-feed-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/webappick-product-feed-for-woocommerce/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [ansarybadal](https://wordpress.org/support/users/ansarybadal/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/php-error-function-get_price-on-bool/#post-15588067)
 * Status: resolved