Support » Plugin: WC Fields Factory » Error on WooCommerce deactivation

  • Hi,
    sorry, again the error I already reported …

    The moment I deactivate WooCommerce, I get this error:
    Fatal error: Uncaught Error: Call to undefined function WC() in ...\wp-content\plugins\wc-fields-factory\includes\wcff-product-fields.php:82

    You should add a method to check if WooCommerce is activated, in the beginning of method registerHooks() you might add WC activation check, something like this:

    public function registerHooks() {
    	if( ! class_exists( 'WC' ) ) {
    		add_action( 'admin_notices', array( $this ,'admin_notice') ); 
    		... the rest of method
    public function admin_notice() {
    	$class = "error updated settings-error notice is-dismissible";
    	$message = __( 'WooCommerce is deactivated or even not installed. WC Fields Factory is useless without WooCommerce - please re-activate WooCommerce or deactivate WC Fields Factory', 'wcff' );
    	echo "<div class=\"$class\"><p>$message</p></div>";

    Please could you fix that asap … ?
    Big thanks (and sorry for spam).

Viewing 1 replies (of 1 total)
  • Anydog


    any update on this ?
    I believe it’s really biggie … The error when main (WooCommerce) plugin is deactivated seems serious to me …

Viewing 1 replies (of 1 total)
  • The topic ‘Error on WooCommerce deactivation’ is closed to new replies.