Skip Navigation

[Resolved] Can't get front-end filters to work.

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

Last updated by Minesh 6 months, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2699716

Tell us what you are trying to do?
Hello, I am trying to insert a filter that allows the user to narrow down the results that show up. The filters appear and even load once pressed, but then the results don't actually change. In this example (battstaging.com the filter is halfway down the page, called "needs trespass")

Is there any documentation that you are following?
I tried reading some documentation about filtering but couldn't figure it out.

Is there a similar example that we can see?
Yes, for example on AirBnB where the user is able to "downselect" the available properties, for example by checking "allows pets" (which would result in a lower number of results than the initial results)

What is the link to your site?
hidden link

#2699789

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

That is strange. I will have to check how you configured your view.

*** 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.

#2699960

Minesh
Supporter

Languages: English (English )

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

I checked and yes I try to filter the results and its not filtering.

In order to minimize the cause of the issue and to ensure there is no conflict between the theme or plugins you are using:

Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?
- Do you see any difference?

What if you try to create a test page and try to add the existing view to that:
- Do you see it working?

What if you try to create a test page and try create brand new view with all the required filters:
- Do you see it working?

#2699996

Hi Minesh,

To be frank, these are not helpful suggestions.

I was able to quickly create a second view, with filters (user is able to search by STATE) here
hidden link

👆As you can see, the filter is actually working, meaning this is not a problem with the theme or *other* plugins. It's a problem with the way I have configured the view in the backend, which is why I was writing to ask for help.

👆The name of the view that is not working is called "MapHome." Please help me understand the backend code with this view, and if you're not able to help, please find a colleague or manager that can.

I am frustrated because this is the second time in a week that I've received unhelpful advice from Toolset. Please remember each time we send messages, this is another day lost due to the timezone change. All of the changes you suggested were things you could have quickly verified yourself -- please be respectful of your customer's time.

Max

#2700149

Minesh
Supporter

Languages: English (English )

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

I understand that how frustrating it could be but we have to follow basic debug steps and sometimes its rewarding and at first glance it helps sometimes to find conflict.

Here is my profile where working hours are mentioned:
- https://toolset.com/forums/users/minesh/

We do not recommond to debug on production sites as if something goes wrong the production site will be down and the aim is to help and fix the issue as soon as possible.

If you really need it I will ask supporter who work in later timezone and you may get quick replay in your timezone.

I checked the following view and it generates the following query and it found no results:
- hidden link

SELECT   wp_wifsdw_posts.*
			 FROM wp_wifsdw_posts  INNER JOIN wp_wifsdw_postmeta ON ( wp_wifsdw_posts.ID = wp_wifsdw_postmeta.post_id )  INNER JOIN wp_wifsdw_postmeta AS mt1 ON ( wp_wifsdw_posts.ID = mt1.post_id )  INNER JOIN wp_wifsdw_postmeta AS mt2 ON ( wp_wifsdw_posts.ID = mt2.post_id )  INNER JOIN wp_wifsdw_postmeta AS mt3 ON ( wp_wifsdw_posts.ID = mt3.post_id )  INNER JOIN wp_wifsdw_postmeta AS mt4 ON ( wp_wifsdw_posts.ID = mt4.post_id )
			 WHERE 1=1  AND ( 
  ( wp_wifsdw_postmeta.meta_key = 'wpcf-containment' AND CAST(wp_wifsdw_postmeta.meta_value AS SIGNED) < '100' ) 
  AND 
  ( mt1.meta_key = 'wpcf-firetype' AND mt1.meta_value = 'wildfire' ) 
  AND 
  ( mt2.meta_key = 'wpcf-acres' AND CAST(mt2.meta_value AS SIGNED) > '100' ) 
  AND 
  ( mt3.meta_key = 'wpcf-last-updated' AND CAST(mt3.meta_value AS SIGNED) > '1716422400' ) 
  AND 
  ( mt4.meta_key = 'wpcf-conus' AND CAST(mt4.meta_value AS SIGNED) = '1' )
) AND wp_wifsdw_posts.post_type = 'fire' AND ((wp_wifsdw_posts.post_status = 'publish' OR wp_wifsdw_posts.post_status = 'private'))
			 GROUP BY wp_wifsdw_posts.ID
			 ORDER BY wp_wifsdw_posts.post_date DESC

It does not display any results as there are no results. Do you want to add the frontend filters you added to "MapHome" view? What exactly not working as based on this review view is not showing output as it does not find any record for the above query generated by view.

If you share bit more information what is your expected results and share all required details, once I review that I will be able to guide you in the right direction.

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

#2700579

Hello Minesh.

Yes, thank you for this information. I apologize if my frustrations came through in my last message.

For the main text list on the homepage, I am trying to allow the users to "downselect" what type of fires show up:

I would like the default option to be a radio button that says "All Fires" (includes both prescribed and also wildfires)

AND

I would like two more radio buttons that allow the user to optionally select either "wildfires only" or "prescribed only" (all fires have a fire type that is one of these two options).

Thank you again and apologies for the previous frustration.

The view is called "Paginated Fires, Home"

#2700641

Minesh
Supporter

Languages: English (English )

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

First of all - about your Firetype field type.

You added the field "Firetype" as textbox. May I know why? As Toolset Types offers option to add Field type Radio or Checkboxes and you can set this field as any of the field type.

if you have only two types value available with the "Firetype" field value that is "wildfire" and "prescribed".

I've adjusted the filter code added to the view's "Search and Pagination" section as given under:

[wpv-control-postmeta display_values="All fires,wildfires only,prescribed only" values=",wildfire,prescribed" field="wpcf-firetype" type="radios" source="custom" url_param="wpv-wpcf-firetype"]

Can you please confirm it works as expected.

#2701287

This totally worked. I believe I can refer back to this to create other filters. THANK YOU.