Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confict with FiboSearch #86

Open
marcocarnazzo opened this issue Jul 13, 2022 · 1 comment
Open

Confict with FiboSearch #86

marcocarnazzo opened this issue Jul 13, 2022 · 1 comment

Comments

@marcocarnazzo
Copy link
Contributor

Describe the bug
Better Search prevents FiboSearch activities.

To Reproduce
Steps to reproduce the behavior:

  1. Install Better Search and FiboSearch
  2. Go to https:///?s=example&post_type=product&dgwt_wcas=1

Expected behavior
FiboSearch should start but Better Search overrides it.

Additional context
Better Search and FiboSearch use boths 's' query param but FiboSearch add also dgwt_wcas to indicate that the request is within its competence.
FiboSearch works goot with Better Search 2.5.3. Today I upgraded Better Search to 3.1.0 and maybe its priority changed.

I resolved with a patch but it's not an elegant solution:

989c989,990
<                       if ( ! is_admin() && $query->is_search() && ! empty( $this->search_query ) ) {
---
> 
>  
@ajaydsouza
Copy link
Contributor

ajaydsouza commented Jul 18, 2022

@marcocarnazzo
I can't see what the patch is above.

One option that I'm thinking that could work is to rewrite that bit of code:

if ( ! is_admin() && $query->is_search() && ! empty( $this->search_query ) ) {
	$flag = true;
} else {
	$flag = false;
}
$flag = apply_filters_ref_array( 'better_search_query_is_search_flag', array( $flag, &$this ) );
return $flag

Then in your theme's functions.php or another plugin you can check if this is a WC produce and set the flag as false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants