Forums Forums Search & Filter Pro Site crashed after updating to 2.0.1

Viewing 10 posts - 1 through 10 (of 20 total)
  • Anonymous
    #25606

    I am getting this error :

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

    And now when I try to visit any page I get a white blank page

    PLEASE HELP.

    I deactivated the plugin but that hasn’t helped, should I uninstall the plugin?

    Thanks!

    Anonymous
    #25607

    I have this in the functions file –

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

    global $sf_form_data;

    if ($sf_form_data->is_valid_form())
    {
    $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 105 is:

    if ($sf_form_data->is_valid_form())

    Ross Moderator
    #25608

    Hi John

    Please see the developer release notes

    http://www.designsandcode.com/documentation/search-filter-pro/2-0-upgrade-notes/

    You are getting an error because you are using a Search & Filter global that no longer exists.

    $sf_form_data has been replaced with $searchandfilter

    However saying that, S&F now works on your woocomerce shop page directly – this is probably the best way to setup:

    http://www.designsandcode.com/documentation/search-filter-pro/3rd-party/woocommerce/

    Thanks

    Anonymous
    #25610

    I re-installed version 1.4.3 and it seems ok now, can you help me fix that error so I can upgrade to V 2.x ?

    Thank you!

    Anonymous
    #25611

    So I should change

    $sf_form_data with $searchandfilter

    then that will fix the broken site, then after that follow that guide to set it up according to V 2.x right?

    Thanks for your fast response,

    John

    Ross Moderator
    #25613

    Hey John

    You best bet to remove all the S&F code from functions.php and to follow the link I sent – much cleaner and easier 🙂

    The idea is that WooCommerce integration is now super simple!

    Thanks

    Anonymous
    #25614

    Ok perfect, so with the new Woocommerce integration it will automatically take my Woocommerce layout/design and everything else?

    Because right now with that code in the functions.php file it looks exactly like my Woocommerce archive pages.

    Thanks

    Ross Moderator
    #25615

    Yeah S&F now works on the Shop page directly, no separate URLs or templates – just check the new docs 🙂

    If you wanted it on a separate URL – but looking the same – then replace $sf_form_data with $searchandfilter but generally speaking directly on your shop is best – if its for filtering your products.

    Thanks

    Anonymous
    #25617

    I will definitely check the new docs, just want to make sure i have everything right … in my head lol.

    So separate URLs meaning all the URLs that S & F currently produces when filtering products won’t exist anymore?

    I think I would like to keep the current URLS S & F currently produces since I have used them in many blogs, and on a ton of different pages for SEO purposes. All I need to know is the best way to upgrade, use the new features, but keep the URLs and layout the way it currently is.

    Thanks, you are awesome!

    Anonymous
    #37853

    Hello Again.

    So if there is no way to use the Woocommerce display and remove the “shop” part of the URL I am stuck with the archive method. Only issue is when I follow your instructions to remove $sf_form_data with $searchandfilter like below:

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

    global $searchandfilter;

    if ($searchandfilter->is_valid_form())
    {
    $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;
    }

    it still breaks my staging site, what else do I need to fix to get it to work properly? I tried only replacing the first instance of $sf_form_data with $searchandfilter and that didn’t work either.

    Thanks

Viewing 10 posts - 1 through 10 (of 20 total)