Skip Navigation

[Resolved] Split: Search Forms doesn't work as expected

This support ticket is created 6 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 74 replies, has 3 voices.

Last updated by CharlesB2907 5 years, 12 months ago.

Assisted by: Nigel.

Author
Posts
#1145665

Actually Waqar, the search form doesn't work. I am completely confused.

I am so completely turned around that I do not know how to ask for help with this insanity.

#1145705

Hi Charles,

I didn't have the exact information about the search form you're referring to, but looking into your website's views, only one of them ("Single Product List Entry") had search filters.

Assuming that this was the search form, I noticed that an important shortcode "[wpv-filter-meta-html]" is missing from the " Output Editor" section of that view.
( screenshot: hidden link )

That shortcode is responsible for showing the search fields and if it is missing, the view will show results but not the search form.

Please include this [wpv-filter-meta-html] shortcode before the [wpv-layout-meta-html] shortcode and the search form should show.

In case you had a different issue/concern in mind, please share its detail and I'll have it investigated, accordingly.

regards,
Waqar

#1145979

Hi Waqar,

This is an example of a subject that has been extremely frustrating for me and I appreciate your patience in trying to help me reach a resolution.

I was in the process of following one of the many varying tutorials for creating a form where I was directed to do so by adding filters to the Search & Filter, now called Search & Pagination. The tutorial was interrupted by step which required the use of Bootstrap which as a Divi builder user, isn't recommended. I have not been able to regain my focus since.

Yes - The search filters I created for "SIngle Product List Entry" (single product page summary view).

My objective is to keep display the Form in two separate locations. Considering the tutorial I was following was intended for Bootstrap, should I have created the form in a different way?

#1145992

Hi Waqar,

I followed your instructions and added the [wpv-filter-meta-html] to the output editor. However, the form still does not produce results to any filter selection I enter. Each time I am directed to a "Results Not Found: page.

How specific is the search logic, meaning if a field is not required and is left blank, are all possible product pages that contain any identical content to be expected to display in the results?

I am sure that my configuration isn't complete.

#1146365

Hi Charles,

When we add search filters to a view, it performs two steps:

1. It adds the query filters settings for each added search field/filter, in the "Query Filter" section:
( example screenshot: hidden link )

2. It adds the HTML and the shortcodes for that field in the search form, in the "Search and Pagination" section.
( example screenshot: hidden link )

Note: more details are available in this guide: https://toolset.com/documentation/user-guides/front-page-filters/

If you'll check your view ( Single Product List Entry ), you'll find that the HTML and shortcodes for the search fields are available in the "Search and Pagination" section", but the "Query Filter" section is empty ( screenshot: hidden link ).

As a result, the search form's fields/filters are showing, but the view doesn't know how to filter or process the results, based on those fields.

Is it possible that the contents of "Search and Pagination" section on this view were originally generated on a different view and then copied to this view? That would explain the missing query filter settings.

To fix this, I'll recommend the following steps:

1. Please remove all the code from the "Search and Pagination" section, that is wrapped within the shortcode [wpv-filter-controls] ... [/wpv-filter-controls].

2. Add your custom HTML code for the search form table, in this shortcode.
( ref: https://toolset.com/forums/topic/search-forms/#post-1145679 )

3. Place cursor, in the table's cell ( i.e. between <td></td>) where you'd like to show the search filter field and use the "New filter" button to add the code for the search field.
( screenshot: hidden link )

4. Repeat the step 3 for each search filter field.

I hope this clarifies and let me know how it goes.

regards,
Waqar

#1146997

Hi Waqar,

I was finally able to achieve form style that I find reasonably acceptable. However, the form is still resulting in an error redirect.

No, I have never copied content between Views. I only have two Views that are active, this one and one for the Homepage.

I tried to remove and reset the fields as you suggested but the form still redirects to an error page.

#1147016

Hi Charles,

If you'll check your content template "Loop item in Homepage view" ( hidden link ), you'll see it is using the following code to call the search form, from the view "Single Product List Entry":


<p style="text-align: center;">{!{wpv-form-view name='single-product-list-entry' target_id='17069'}!}</p>

But the page/post selected to show the results on (through the "target_id" parameter "17069"), seems to have been deleted.
( hidden link )

Please update the ID with a page that exists and is published and the results will show on that page.

regards,
Waqar

#1147022

Hi Waqar,

When you just checked the homepage did you adjust any setting that would re-enable Bootstrap?

just within a short period of time, the homepage layout has fallen seriously out of alignment where the page appears crunched down and inward.

Very disappointed to see this and happen at this point.

#1147073

Hi Charles,

I didn't make any changes to the website's settings, which could result in Bootstrap loading.

You're welcome to share more specific details about the homepage's layout issue, in a separate ticket and we'll investigate it accordingly.

regards,
Waqar

#1147087

Hi Waqar,

I was experiencing some very strange and unacceptable behavior that I could not track the cause of. I had no choice but to restore the last 24 hour back-up and I am in the process of re-establishing the last days work from project notes.

I do not know what caused this. I will be more watchful as well as make more frequent back-ups moving forward.

#1147208

Hi Charles,

Making periodic backups is a good practice and sometimes cache and code optimization plugins can also result in unexpected or inconsistent results.

Those plugins can hold on to cached data for a longer durations to boot performance, but the downside is that changes you're making on the website can reflect on the front-end after some delay, making you believe that they're not applying at all.

For this reason, it is generally considered a good development practice, to enable those plugins after the development work has finished.

Please open a new ticket if you have any further questions - we're here to help.

regards,
Waqar

#1147320

Hi Waqar,

Thank you for following up on this concern. I take full responsibility for the crash and effort needed for recovery. I'm new at this level of integration and although I am learning, I believe that I may have been careless while the site is still not yet complete.

I am now running more frequent backups.

#1147467

Hi Waqar,

Resuming once again, I want to reference you reply #1147016. I am unclear here. I see the Divi module containing the shortcode {!{wpv-form-view name='single-product-list-entry' target_id='17069'}!} which is meant to display the results directly below the form on the home page if possible. This would be perfect if I could by some means enable the results to rise up to the top of the screen perhaps with an anchor point of sorts.

I was unable to open the last link in your replay so I am not sure what you end point was. I gather that there is a missing part of the shortcode and it has to be placed in the correct location. I want to note that the Search form should be accessible from two locations 1. the Homepage and 2. the Product page navigation link search other work.

I will further mention that it would be great if when the results posted, the thumbnails in the results if clicked opened in a different browser window.

#1147871

Hi Charles,

When the "target_id" parameter is included to the "wpv-form-view" shortcode ( e.g. {!{wpv-form-view name='single-product-list-entry' target_id='17069'}!} ), it means that you are directing the form to show the results on a different page or post, whose ID is included.

But, in your case, the ID "17069" that is in use is for a deleted page/post, which is why the error message is shown when you try to visit its edit page ( hidden link ).
Screenshot: hidden link

If you'll remove the target_id='17069' part from the shortcode, you'll see that the form's search results will show on the homepage below the form.

To avoid any further confusion around showing the search form and the results from views, I'll strongly recommend practicing different ways to insert its shortcode, on a temporary page, to see the effect of your choices. You'll find fairly detailed information on the topic along with the screenshots in my reply to your different ticket at:
https://toolset.com/forums/topic/search-forms/#post-1142857

To make any link open in a new browser tab, you just need to introduce the target="_blank" attribute to it's a tag:
hidden link

regards,
Waqar

#1147942

I did exactly as you instructed. I removed target_id='17069' and the shortcode is now {!{wpv-form-view name='single-product-list-entry'}!} which is entered into the Divi modules for the Homepage and a static search form page.

No search results displayed.