Fatal error when WooCommerce inactive
-
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 thoseadd_action
s into functions called onwoocommerce_init
orwoocommerce_loaded
.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Fatal error when WooCommerce inactive’ is closed to new replies.