Support » Plugin: PayPal for WooCommerce » PHP Fatal error: Call to undefined function wc_add_notice()

  • I have just started using this plugin. It works very well. However, when checking my error logs, I noticed this error shows up all the time.

    PHP Fatal error: Call to undefined function wc_add_notice() in /xxxxxx/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19

    Since wc_add_notice() is a Woocommerce function, I am puzzled why it is not being found? Could it be because I have the built-in Paypal module also installed?

    https://wordpress.org/plugins/paypal-for-woocommerce/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author angelleye

    (@angelleye)

    Yeah that is an interesting error to be getting. I haven’t had any other reports of it, and I’m not seeing in my own error logs, so there must be something unique going on there.

    My initial thought is that it could have something to do with caching / CDN services. Are you using anything like that? Who are you hosting with?

    Thanks for such a fast response. I do have CDN enabled. I am hosting with Pagely. Should I ask them for assistance in solving this?

    It seems very odd that wc_add_notice() is not found.

    Plugin Author angelleye

    (@angelleye)

    Can you disable that cdn service temporarily and then make sure to clear all of your cache and then try again to see if the issue goes away?

    The caching is all done from the hosting side. I guess I can disable the Caching completely from my dashboard. Then I can wait till I receive a Paypal order (since the error happens when someone tries to use Paypal Express).

    After that I can check the debug.log for this message.

    Did I understand you correctly?

    I am not having much luck from the hosting support staff today. I got the boilderplate response as below. I don’t think he even read my message in entirety before responding. Sorry to digress, but I also noticed this other error message as well:

    [02-Aug-2016 22:22:54 UTC] PHP Notice:  Trying to get property of non-object in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 8
    [02-Aug-2016 22:22:54 UTC] PHP Notice:  Trying to get property of non-object in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 14
    [02-Aug-2016 22:22:54 UTC] PHP Fatal error:  Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19

    Hello,

    This error would be due to the plugin or dependencies it has on another plugin or your theme, most likely WooCommerce.

    I’m not sure how you are equating to caching/CDN but reading the error it clearly states that its making a call to an undefined function wc_add_notice()

    I recommend making sure it’s compatible with your version of WooCommerce.

    I am receiving this error message from the plugin repeatedly. At this point, I am not sure what to do to debug this? It looks like it gets generated when someone is trying to check out using Paypal.

    [02-Aug-2016 23:28:45 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 00:06:36 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 00:07:18 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 00:08:50 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 00:09:22 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 00:14:14 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 00:19:57 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 00:20:43 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [03-Aug-2016 01:32:53 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /dom10077/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19

    Plugin Author angelleye

    (@angelleye)

    Have you been able to disable the CDN service so you can run a test without it running?

    The next step would be to disable other plugins to see if the problem goes away. If so, then re-enable each until it comes to find the culprit.

    If none of the plugins seem to be the problem then the next step would be to try one of the basic “Twenty” themes to see if the problem goes away then.

    Of course, it’s recommended to do this sort of testing on a staging copy of your site so you don’t have to mess with the live version. Your host should be able to help you set that up if you don’t already have it.

    I have just checked my error logs and I am also getting so many of the exact same error.
    Have you had any updated on this, I am worried it is affecting sales?
    [25-Sep-2016 21:04:57 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in /home/bodyplu1/public_html/bodyment/wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [25-Sep-2016 21:10:34 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in */wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [25-Sep-2016 21:21:57 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in */wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [25-Sep-2016 21:32:43 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in */wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19
    [25-Sep-2016 21:38:52 UTC] PHP Fatal error: Call to undefined function wc_add_notice() in */wp-content/plugins/paypal-for-woocommerce/template/paypal-review-order.php on line 19

    So many of these its mind blowing.
    * Removed for privacy.
    Help please.

    Plugin Author angelleye

    (@angelleye)

    You can see here that wc_add_notice() is still a valid function with the latest version of WooCommerce, so if your system isn’t able to find it then something must be conflicting.

    If you’ve already checked caching / CDN services in WordPress or on your server directly, then the next thing I would recommend would be to disable other plugins temporarily to see if the issue goes away. If so, then re-enable one-by-one until the problem comes back to find the culprit.

    If none of the plugins seem to be causing it, then it could be the theme, so you should also try switching to one of the basic “Twenty” themes to see if the problem goes away then.

    If you can find the culprit then we can install it here to reproduce the error. At that point we can figure out if it’s a problem in our plugin, the conflicting plugin, or both.

    Again, though, wc_add_notice() is a very common function for WooCommerce that is used to add notes to orders, so there’s no reason it wouldn’t be available unless some other class/function was killing it.

    I get the same issue in my paypal-review-order.php that is within the theme folder. I see it on the rebuild index page for the Relevanssi plugin.

    Plugin Author angelleye

    (@angelleye)

    @thebarton, can you try a different theme temporarily to see if the issue goes away?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘PHP Fatal error: Call to undefined function wc_add_notice()’ is closed to new replies.