• Resolved Nathan

    (@nhadsall)


    In class-enhanced-ecommerce-google-analytics.php on line 220, function run() uses printf to give an error notice. For some reason get_option(?‘active_plugins’?) is missing woo. However this is not correct. Woo is installed and active. I believe some other plugin is in conflict here.

    However, my issues is that the error notices should not be visible on the front end to non logged in users. Can you please add a catch to only show this notice to admins? Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Conversios

    (@tatvic)

    Hey Nathan,

    We have used the standard WooCommerce function, however we are not sure how this is occurring for your store. Maybe, as you pointed out there could be a conflict with other plugin or something else.

    Below is the solution for the issue you are facing:
    1. Make change as described below:

    File Path: enhanced-e-commerce-for-woocommerce-store/includes/class-enhanced-ecommerce-google-analytics.php

    Line No: 220

    Replace “run function” with below function:

    public function run() {
    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    add_action('woocommerce_init' , function (){ $this->loader->run(); });
    }else if( is_plugin_active( 'enhanced-e-commerce-for-woocommerce-store/enhanced-ecommerce-google-analytics.php' ) ){
    printf('<div class="notice notice-error"><p>Hey, It seems WooCommerce plugin is not active on your wp-admin. Enhanced ecommerce plugin can only be activated if you have active WooCommerce plugin in your wp-admin.</p></div>');
    }
    }

    2. Also, make this change as well:

    File Path: enhanced-e-commerce-for-woocommerce-store/public/class-enhanced-ecommerce-google-analytics-public.php

    Line no: 144

    replace if condition with the below code:

    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
    // Put your plugin code here
    add_action('woocommerce_init' , function (){
    $this->ga_LC = get_woocommerce_currency(); //Local Currency from Back end
    $this->wc_version_compare("tvc_lc=" . json_encode($this->ga_LC) . ";");
    });
    }

    Let me know if this works.

    Plugin Author Conversios

    (@tatvic)

    Hi,

    Have you tried the given solution?
    Did this work for you?

    Plugin Author Conversios

    (@tatvic)

    Hi,

    Seems you have got the solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error notice crashes page’ is closed to new replies.