• Hi,
    I’ve built a B2B plugin for WooCommerce and I’m having issues with a problem that I am not able to understand and fix.

    In the admin side, the WooCommerce Dashboard hangs (the charts will not load). The problem code is in my plugin:

    if ( is_admin() ) { 
        //removed   
    } else if ( !$this->is_login_page() && !wp_doing_ajax() ) {
        $public = new Public();
    }

    It’s the public side code that’s causing the issue! and neither is_admin or wp_doing_ajax prevent it from happening!

    In the public side, I’m calling
    add_action( 'init', array('Dynamic_Rules', 'dynamic_rule_tax_exemption') );
    And this code in particular, called on init is the issue:

    function dynamic_rule_tax_exemption(){
    $woocommerce = WC();
    $user_country = $woocommerce->customer->get_billing_country();
    $woocommerce->customer->set_is_vat_exempt(true);
    }

    It looks like calling WC() is sending it into an infinite loop? Am I wrong to call that function on init?

    Please help me understand what is happening in the WooCommerce Dashboard and why it accesses code protected via is_admin() and wp_doing_ajax()

    • This topic was modified 4 years, 6 months ago by WebWizards.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WooCommerce Dashboard Loading Issue – Plugin Conflict’ is closed to new replies.