• Resolved Brian Henry

    (@brianhenryie)


    Fatal error: Uncaught Error: Undefined constant "WC_VERSION" in /path/to/wp-content/plugins/pricing-deals-for-woocommerce/woo-integration/vtprd-parent-functions.php:5434 
    Stack trace: 
    #0 /path/to/wp-content/plugins/pricing-deals-for-woocommerce/vt-pricing-deals.php(171): require_once() 
    #1 /path/to/wp-includes/class-wp-hook.php(303): VTPRD_Controller->vtprd_controller_init('') 
    #2 /path/to/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) 
    #3 /path/to/wp-includes/plugin.php(470): WP_Hook->do_action(Array) 
    #4 /path/to/wp-settings.php(578): do_action('init') 
    #5 /path/to/wp-config.php(79): require_once('/Users/brianhen...') 
    #6 /path/to/wp-load.php(50): require_once('/Users/brianhen...') 
    #7 /path/to/wp-admin/admin.php(34): require_once('/Users/brianhen...') 
    #8 /path/to/wp-admin/plugins.php(10): require_once('/Users/brianhen...') 
    #9 {main} thrown in /path/to/wp-content/plugins/pricing-deals-for-woocommerce/woo-integration/vtprd-parent-functions.php on line 5434
    if ( version_compare( WC_VERSION, '3.1.2', '>=' ) ) {   
      add_action('woocommerce_new_product_variation',   'vtprd_update_session_ts_on_price_change') ;
    } else {
      add_action('woocommerce_create_product_variation',   'vtprd_update_session_ts_on_price_change') ;  
    }

    which you could change to

    if ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '3.1.2', '>=' ) ) {

    but there’s still other places that need that check too.

    That code is running on init, so another option is to move those add_actions into functions called on woocommerce_init or woocommerce_loaded.

Viewing 1 replies (of 1 total)
  • Plugin Author vark

    (@vark)

    Hi,
    Thanks for letting me know about this.
    www.ads-software.com is currently requiring a few changes for security purposes, and I’ll put in a fix for this at the same time into v2.0.3.
    Best,
    Vark

Viewing 1 replies (of 1 total)
  • The topic ‘Fatal error when WooCommerce inactive’ is closed to new replies.