Support » Plugin: WooCommerce » PHP Notice: wc_get_product was called incorrectly. wc_get_prod

  • Resolved strike0concepts

    (@strike0concepts)


    Just upgraded hosting, and the site was migrated to a new server. Since the migration, the checkout page isn’t loading correctly (unusable) and the debug log is throwing out hundreds of the following:

    PHP Notice: wc_get_product was called <strong>incorrectly</strong>. wc_get_product should not be called before the woocommerce_init action. Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('plugins_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, Cooked_Pro_Plugin->init, Cooked_Pro_Plugin->module_setup, require_once('/plugins/cooked-pro/modules/content/content.php'), Cooked_Content->__construct, Cooked_Settings::get, Cooked_Settings::tabs_fields, Cooked_Settings::pages_array, get_the_title, apply_filters('the_title'), WP_Hook->apply_filters, SFN_Cart_Addons->the_title, sfn_get_product, wc_get_product, wc_doing_it_wrong Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 2.5.) in /home/ausinchies/public_html/wp-includes/functions.php on line 4773

    Where do I start looking to find the cause of this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @strike0concepts!

    Issues like this are usually caused by either a conflict with the theme or with another active plugin on the site.

    With that said, I would recommend you switch to a default theme, like Storefront, to see if the issue persists. If the issue goes away, then you’ll need to contact your theme author to resolve this. If the issue is still there, then you’ll need to disable all your plugins, except for WooCommerce, to see if that resolves the issue. If it does, please re-enable your features one at a time until it breaks again, and then contact the author of the conflicting plugin for further help.

    Please let us know how it goes.

    Cheers!

    • This reply was modified 1 month, 3 weeks ago by  Rynald0s.
    Plugin Support Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.