Skip Navigation

[Resolved] Following up my last ticket.

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

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by Waqar 2 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2221395
WhatsApp Image 2021-11-15 at 6.23.51 PM.jpeg

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!

#2221947

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

#2223809

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

#2223945

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

#2224779

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.