Skip Navigation

[Resolved] ajax filters not working properly

This support ticket is created 5 years, 1 month 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
- 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/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by chrisT-20 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1422505

Hi,

The filters are not working properly on:

hidden link

the first filtering action works fine but subsequent filters do not.

We have the same functionality problems on the live site but I have commented out two of the filtering fields - you can see an example of that here:

hidden link

It works well with just one filtering field.

#1422813

Hello,

Thanks for the details, I can log into your website.
I have done below modifications in your website:
1) Edit the post view "AvailableUnits", click "Screen Options", Option "View purpose" choose "Full custom display mode", so you will be able to see all sections of view.

2) in section "Query Filter", you where using filter:
Bedrooms is a string equal to URL_PARAM(bedrooms)
The URL parameter name "bedrooms" is wrong,
in section "Search and Pagination", you are using below shorcode:

[wpml-string context="wpv-views"]<p>Bedrooms</p>[/wpml-string] [wpv-control-postmeta field="wpcf-bedrooms" type="select" auto_fill_default="Bedrooms" url_param="wpv-wpcf-bedrooms" output="legacy"  default_label="All" auto_fill_sort="asc"]

The URL parameter name is different: wpv-wpcf-bedrooms

So I have edit the filter to:
Bedrooms is a string equal to URL_PARAM(wpv-wpcf-bedrooms)

3) in section "Search and Pagination", it is recommended to display a default option for those select fields, I have changed all three select field shortcodes, add the attribute default_label="All", for example:

[wpml-string context="wpv-views"]<p>Bedrooms</p>[/wpml-string] [wpv-control-postmeta field="wpcf-bedrooms" type="select" auto_fill_default="Bedrooms" url_param="wpv-wpcf-bedrooms" output="legacy"  default_label="All" auto_fill_sort="asc"]

So it will be able to display output a default option "All" in front-end, see the result here:
hidden link

Please test it, check if it is fixed. thanks

More help:
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-control-postmeta
default_label (opt):
'default option text'
Add default option like All or Any on taxonomy select control.

#1443343

Thanks for your help Luo - it is working well and I have implemented on the live site as well.

Cheers

Chris