• Hello
    I have a compatibility issue, when both plugins, this and the WooMultistore https://woomultistore.com/ are enabled, then in the backend products page, the search function is not more working at all, the result of any search is the latest products list.
    It happens either if I disable all other plugins.
    Any help would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sb5

    (@sb5)

    Hello.
    I m not plugin developper, but I finally tried to have a look there…
    The issue seems to be located in the function : extend_admin_search() that is called in case the option to admin-search in GTIN is ticked.
    The thing is that both plugin are hooking the meta_query element of the query object. But this plugin just set the meta_query array without testing if the element already exists.

    So by replacing those lines :

    $meta_query = array( 'relation' => 'OR' );
    			array_push( $meta_query, array(
    				'key'     => '_wpm_gtin_code',
    				'value'   => $search_term,
    				'compare' => 'LIKE'
    			) );

    by those ones :

    $meta_query = $new_query->get('meta_query');
    			if( empty( $meta_query ) ){
    				$meta_query = array();
    			}
    			array_push( $meta_query, array(
    				'relation' => 'OR', 
    				'key'     => 'wpm_gtin_code',
    				'value'   => $search_term,
    				'compare' => 'LIKE'
    			) );

    seems to fix the issue.

    Dear Emanuela could you please confirm this is the correct way to fix that issue ?

    I had the same problem with WooMultistore and above solution from @sb5 worked for me.

    I hope it will be fixed in a newer update of this plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatibility issue breaks the backend product search’ is closed to new replies.