I would like to add one small feature in my search engine that I also mentioned in my last ticket. It is stated below:
Place the first model in the list, after you select brand because our users get lost after selecting a brand and they see "results not found"/
hidden link
I'm also attaching a screenshot for reference.
teddypardo.com
P.S: The user is already created and credentials are shared in my last ticket.
Thank you!
Hi,
Thank you for contacting us and I'd be happy to assist.
When a ticket is closed/resolved the private information like access details are removed from it.
Can you please share the temporary admin login details again, so that I can see how this view is set up?
I'll be in a better position to suggest the next steps, accordingly.
Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.
regards,
Waqar
Thank you for sharing these details.
The way the relationship filter works, the results are are only shown, when a value has been selected in all the relationship fields.
This means that the visitors will only start seeing results, once they've selected a "Brand" and "Model". I've added some conditional display blocks in the view's "Loop Editor" so that when a visitor selects "Brand", message to select "Model" is shown and when both have been selected only then the result's heading and section is shown:
[wpv-layout-start]
[wpv-conditional if="( '[wpv-search-term param='wpv-relationship-filter-brand1']' ne '' ) AND ( '[wpv-search-term param='wpv-relationship-filter']' eq '' )"]
<h4>Select Model</h4>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-search-term param='wpv-relationship-filter']' ne '' )"]
<h3>Search Results</h3>
[wpv-items-found]
<!-- wpv-loop-start -->
<ul class="wpv-loop js-wpv-loop">
<wpv-loop>
<li>[wpv-post-body view_template="loop-item-in-view"]</li>
</wpv-loop>
</ul>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[/wpv-conditional]
[wpv-layout-end]
I hope this helps and please let me know if you need any further assistance around this.
Thank you so much for this!
The thing is, in our case, many brands have just one single model, so instead of asking the user to select a single model, is it possible to show him any model and save the extra time and clicks ?
Thanks again, Yair
To automatically select the first available option in the "Models" field, when a "Brand" is selected, you can include the following script in the "JS editor" under the view's "Search and Pagination" section:
jQuery( document ).on( 'js_event_wpv_parametric_search_form_updated', function( event, data ) {
if(jQuery("select[name=wpv-relationship-filter]").val() == 0) {
jQuery("select[name=wpv-relationship-filter]").val(jQuery("select[name=wpv-relationship-filter] option:nth-child(2)").val());
jQuery("select[name=wpv-relationship-filter]").trigger("change");
}
});
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/