• Resolved panon

    (@panon)


    After update to 2.3.3 the woocommerce search returns nothing.
    If you disable the plugin everything works smoothly with the search

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes, I had this issue too, it’s because of the custom query search function in file:
    back-in-stock-notifier-for-woocommerce/includes/admin/class-post-type.php

    public function custom_search_query( $query) {
    			$custom_fields = array(
    				'cwginstock_subscriber_name',
    			);
    			$searchterm = $query->query_vars['s'];
    			$searchterm = $query->query_vars['post_type'];
    			$query->query_vars['s'] = '';
    			if ('' != $searchterm) {
    				$meta_query = array('relation' => 'OR');
    				foreach ($custom_fields as $cf) {
    					array_push($meta_query, array(
    						'key' => $cf,
    						'value' => $searchterm,
    						'compare' => 'LIKE'
    					));
    				}
    				$query->set('meta_query', $meta_query);
    			};
    		}

    This code gets applied to all search queries, I’ve edited it to fix quickly:

    public function custom_search_query( $query) {
    			$custom_fields = array(
    				'cwginstock_subscriber_name',
    			);
    			$searchterm = $query->query_vars['s'];
    			$post_type = $query->query_vars['post_type'];
    			if ($post_type === 'cwginstocknotifier') {
    			$query->query_vars['s'] = '';
    			if ('' != $searchterm) {
    				$meta_query = array('relation' => 'OR');
    				foreach ($custom_fields as $cf) {
    					array_push($meta_query, array(
    						'key' => $cf,
    						'value' => $searchterm,
    						'compare' => 'LIKE'
    					));
    				}
    				$query->set('meta_query', $meta_query);
    			}
    			};
    		}

    Please fix it ??

    Plugin Author CodeWooGeek

    (@codewoogeek)

    Hello @panon @hebafareed ,

    Good Day !!!

    Thanks for the heads up ??

    We’ve fixed your reported issue as a quick fix v2.3.3.1. Please update it and check it out.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2.3.3 update conflicts with search’ is closed to new replies.