• Resolved disinfor

    (@disinfor)


    The plugin is throwing a fatal error:

    Fatal error: Uncaught Error: Call to undefined function wc_print_notices() in /var/www/html/wp-content/plugins/woo-add-to-quote/shortcodes.php:17

    require_once('functions.php'); in the main plugin file woo_add_to_quote.php should be wrapped in a check to see if WooCommerce has been loaded because plugins load at different times.

    You might want to consider wrapping that in a function that gets called on the plugins_loaded hook or refactor the watq_check_if_woo_is_active function a little bit to include the include.

    Something like this would work without refactoring the watq_check_if_woo_is_active function.

    
    function watq_load_functions() {
        if ( class_exists('WooCommerce') ) {
            require_once('functions.php');
        }   
    }
    
    add_action( 'plugins_loaded', 'watq_load_functions' );
    
    • This topic was modified 6 years ago by disinfor. Reason: code
Viewing 1 replies (of 1 total)
  • Plugin Author WPExperts.io

    (@wpexpertsio)

    Hi @disinfor!

    Really appreciate for sharing this issue over here. Just hit update and you are good to go.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Fatal Error: Call to undefined function wp_print_notices’ is closed to new replies.