Skip Navigation

[Resolved] Hide the search results until the first search

This support ticket is created 2 years, 8 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.

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 8 replies, has 2 voices.

Last updated by imedB 2 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#2446943
config-if-loop.jpg

Tell us what you are trying to do? : i want to : Hide the search results until the first search. I followed your procedure but it didn't work. please enlighten me please

Is there any documentation that you are following? Yes : https://toolset.com/fr/lesson-placement/lesson-placements-1622935-1621213/#hide-the-search-results-until-the-first-search

What is the link to your site? hidden link

please enlighten me please
Imed

#2446955

The problem is that : all the search requests are hided (i ve never get search results any more).
All is hided.

Please help.

Cdlt
Imed

#2446967

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL where you want to hide the search results as well as admin access details. Let me review your setup and check whats going wrong.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2446999

Minesh
Supporter

Languages: English (English )

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

Can you please check now, I've adjsuted the condition you added as:

  ( ( '[wpv-search-term  param='wpv_view_count']' ne '' ) ) 

Can you please confirm it works as expected now.

#2447007

Hello,
And thank you for your help.

Below are my questions:
1) First: I didn't understand the change you made (I already wrote the IF condition)
2) Second: Your modification works the first time, but,
When I do a reset with the 'Clear all filters' button, the same problem reappears: all the data is displayed whereas logically I should have no results!!!
What are we doing ?
I need that the OutLopp resultats displays nothing when i click the 'Clear All filters'.

Can you help me please?

cdlt
Imed

#2447037

Minesh
Supporter

Languages: English (English )

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

1) First: I didn't understand the change you made (I already wrote the IF condition):
==>
- The if condition should have single quote when I checked it was using some other kind single quote. So I changed it to as given under and saved the view and when I checked on frontend its started working.

2) Second: Your modification works the first time, but,
When I do a reset with the 'Clear all filters' button, the same problem reappears: all the data is displayed whereas logically I should have no results!!!
What are we doing ?
==>
As per the doc:
- https://toolset.com/fr/lesson-placement/lesson-placements-1622935-1621213/#hide-the-search-results-until-the-first-search

What you are comparing and checking with conditional statement is we are checking if URL param "wpv_view_count" is not equal to null but when you click on reset button the URL param should be there. As per the doc, the condition shared will be work until the first search but when you click on reset button the URL param will be available in the URL param. So you will have to check that if the url param for the filter is empty then you should hide the search.

like when you search with the filter "Catégorie de COMPET" then it will add the URL param: wpv-categorie-of-compet
So, you will have to add all of your filter URL params to the conditional statement. For example:

( ( '[wpv-search-term  param='wpv_view_count']' ne '' ) OR   ( '[wpv-search-term  param='wpv-categorie-of-compet']' ne '' )  ) 
#2447053

Hi, Thank you for your rapide answear,

I do this for the IF condition (as you mentionned) :
( ( '[wpv-search-term param='wpv_view_count']' ne '' ) OR ( '[wpv-search-term param='wpv-categorie-of-compet']' ne '' ) OR ( '[wpv-search-term param='wpv-nature-innovation-of-compet']' ne '' ) OR ( '[wpv-search-term param='wpv-technologie-of-compet']' ne '' ) OR ( '[wpv-search-term param='wpv-department-of-compet']' ne '' ) OR ( '[wpv-search-term param='wpv_post_search']' ne '' ) )

And it doesn't work and i got "'OR Incomplete condition".

Thank you for your help
Cdlt
Imed

#2447101

Minesh
Supporter

Languages: English (English )

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

Could you please check now.

I've adjusted the conditional as given under:

 NOT ( empty( '[wpv-search-term       param='wpv-categorie-of-compet']') AND empty( '[wpv-search-term      param='wpv-nature-innovation-of-compet']') AND empty( '[wpv-search-term      param='wpv-technologie-of-compet']') AND empty( '[wpv-search-term      param='wpv-department-of-compet']') ) 

Can you please confirm it works as expected.

#2447115

My issue is resolved now. Thank you!
we learn on the job
tutorials are not enough
but the quality of the support is ok
thank you
Imed