Skip Navigation

[Resolved] The search function is showing results before form submission.

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 4.17 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 5 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1337253

I am trying to: Only show the meta information for HOA Partner Name, HOA Phone Number and HOA Category Name when submitting the form on the page below. It shows all results currently even after I used a filter provided previously from support and changed the View name.

Link to a page where the issue can be seen: hidden link

I expected to see: No results until I enter the zip code and category. Then only the company associated with both.

Instead, I got: All meta info from every HOA Partner and upon submission just a blank bullet point.

#1337325

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The admin access details you shared is not working at this end.

Can you please try to add the following code to your current theme's functions.php file:

add_filter( 'wpv_filter_query', 'show_empty_default_func', 10, 2 );
     
function show_empty_default_func( $query_args, $setting ) {
    if($setting['view_id'] == 783)
    {
        if( !isset($_GET['wpv_post_search'])) 
        {
            $query_args['post__in'] = array(0);
        }
    }
    return $query_args;
}

More info:
=> https://toolset.com/documentation/user-guides/views-filters/#wpv_filter_query