class JSF_Search_By_Post_Tiltle_Shop {
    
    public $key = 'search::post_title_shop';
    
    public function __construct() {
        add_filter( 'jet-smart-filters/query/final-query', array( $this, 'modify_query' ) );
    }
    
    public function modify_query( $query ) {
        
        if ( ! isset( $query['meta_query'] ) ) {
            return $query;
        }
        
        foreach ( $query['meta_query'] as $key => $item ) {
            if ( false !== strpos( $item['key'], $this->key ) ) {
                
                unset( $query['meta_query'][$key] );
                
                global $wpdb;
				
                $sql = "SELECT ID FROM {$wpdb->posts} WHERE post_status = 'publish' AND post_type = 'product' AND post_title LIKE '%{$item['value']}%'";
                $posts = array_column( $wpdb->get_results( $sql, 'ARRAY_A' ), 'ID' );
                
                if ( ! empty( $posts ) && isset( $query['post__in'] ) ) {
                    $query['post__in'] = array_intersect( $posts, $query['post__in'] );
                } elseif ( ! empty( $posts ) ) {
                    $query['post__in'] = $posts;
                }

                if ( empty( $query['post__in'] ) ) {
                    $query['post__in'] = array( 0 );
                }
                
            }
        }

        return $query;
        
    }
    
}

new JSF_Search_By_Post_Tiltle_Shop();