Forums › Forums › Search & Filter Pro › Site crashed after updating to 2.0.1
- This topic has 19 replies, 2 voices, and was last updated 8 years, 8 months ago by Anonymous.
-
Anonymous(Private) September 23, 2015 at 6:39 pm #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(Private) September 23, 2015 at 6:42 pm #25607I 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(Private) September 23, 2015 at 6:48 pm #25608Hi 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
Ross Moderator(Private) September 23, 2015 at 6:54 pm #25613Hey 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(Private) September 23, 2015 at 6:56 pm #25614Ok 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(Private) September 23, 2015 at 6:58 pm #25615Yeah 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(Private) September 23, 2015 at 7:10 pm #25617I 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(Private) February 24, 2016 at 7:43 pm #37853Hello 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
-
AuthorPosts