New Error: Fatal Error

Forums › Forums › Search & Filter Pro › New Error: Fatal Error

Viewing 4 posts – 1 through 4 (of 4 total)
  • Anonymous
    #38910

    Hey Ross, now I am getting this error intermittently on various category pages:

    Fatal error: Call to a member function active_sfid() on a non-object in /home/doglov7/public_html/wp-content/themes/canvas/functions.php on line 106

    When using this code:

    add_filter(‘body_class’,’add_body_class_to_search_filter’);
    function add_body_class_to_search_filter($classes) {

    global $searchandfilter;

    if($searchandfilter->active_sfid())
    {
    $classes[] = “tax-product_cat archive woocommerce woocommerce-page alt-style-default

    boxed-layout two-col-right width-930 two-col-right-930”;
    }
    // return the $classes array
    return $classes;
    }

    Line 106 is:

    if($searchandfilter->active_sfid())

    Thanks!

    Anonymous
    #39307

    Any help with this Ross?

    Thanks

    Ross Moderator
    #39396

    Hi John

    If the global $searchandfilter does not exist, it means that either Search & Filter is disabled, or something is trying to access it before the action plugins_ready is fired.

    This could be a symptom of another issue, but a quick workaround could be to check if its set first.

    After:

    global $searchandfilter;

    Add

    if(!isset($searchandfilter))
    {
        return $classes;
    }

    Thanks

    Anonymous
    #40561

    I will give that a try.

    Thanks Ross

Viewing 4 posts – 1 through 4 (of 4 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.