Skip Navigation

[Resolved] Filter by date range or price range

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

This topic contains 12 replies, has 2 voices.

Last updated by Jeffrey 6 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#547724

I am trying to use a filter by a date range and a price range,

I visited this URL: https://toolset.com/forums/topic/disable-certain-datepicker-dates-depended-on-another-datepicker-value/#post-330995

but for me a WP beginner, to know what the article says is too difficult, can you send me a private link, and I will show you password and user name for access to my site. Please help me set it up, and just tell me what parametric or value you have revised, so that if further I meet similar issue, I will know what I should do. thank you so much, when I got the link, I will upload the screenshots and link and describing of issues. Thank you so much !

#547774

Dear jianfeng,

Here is a document about "Date Filters":
https://toolset.com/documentation/user-guides/date-filters/
section "Filtering Between Dates"

But the thread you mentioned above:
https://toolset.com/forums/topic/disable-certain-datepicker-dates-depended-on-another-datepicker-value/#post-330995

It is for setup the date-picker's date range in front-end, it is using custom Javascript codes, this is not built-in feature of Views plugin, which is out the range of Toolset support, if you still need assistance for it, please provide a test site with same problem, also point out the problem page URL and view URL in below private detail box, thanks

#549689

OK, please update this thread when your test site is ready, thanks

#551121

Hello, Mr. Yang, could you please resend me the private link to me? I wanna send the pages and description to you

#551141

OK, I just enabled the "private detail box", please provide the credentials with a minimal wordpress installation(without other plugins)

#551174

I assume we are talking about the custom numeric field "Monthly rate(USD)":
hidden link
This custom field is registered to post type "Rooms", but the View you mentioned above is querying another post type "Hosts", so the filters won't work, it is possible to query "Hosts" posts and filter by the fields of another post type "Rooms".

For test purpose, I create a new view in your website:
hidden link
Query the "Rooms" posts
filter by:
Select items with field:
Monthly rate(USD) is a number between URL_PARAM(wpv-wpcf-monthly-rateusd_min), URL_PARAM(wpv-wpcf-monthly-rateusd_max)

See it in front-end:
hidden link

for example 3000~4000:
hidden link

#551204

I have tried to add the filter you made by monthly rate field to the view of post type of the Hosts, and checked the box for Rooms, but I found the search results which are for Room when I filter by field of child post type. Can it only display the search results page for Host? even some search options are for parent post type fields and some else options are for child post type? Thanks!

#551258

Yes, you can query the child "room" posts, and display the parent "host" information, see our document:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

#553236

Hi Mr. Yang,

Thank you so much for your help!
1. How to set up the price or date range as Min price/ date is less than/no later than Max price/date? it used to prevent user's properly choosing,

2.I have read the article above you mentioned, and below described what I want to see.

Parent: house, that includes, location, and owner information
Child: room, that includes room facility and room price and available time,
and all of information were displayed in parent post

is it possible to use a search form to query by location and owner information and then filter by price and available time?

I have tried to add the child type into the parent view, and checked the post type box, and added price range and date range into filter, but I found it can not display results with combine filter, for example, I can not search by location and price range together

if I only choose factors of search form in parent or child type, it will display all of posts including house and room, is it possible to only display parent post,? it looks like

hidden link;

when you search a room during specified period, you just wanna see a hotel list if any rooms available during this period.

Best regards

#553308

Q1) is it possible to use a search form to query by location and owner information and then filter by price and available time?
There isn't such a feature within Views plugin, Views is using wordpress class WP_Query to query posts:
https://codex.wordpress.org/Class_Reference/WP_Query
When you are querying posts of post type "Room", you can filter by the fields and taxonomy of post type "Room", you can not filter by fields and taxonomy of other post type "House"

Q2) if I only choose factors of search form in parent or child type, it will display all of posts including house and room, is it possible to only display parent post,?
For the reason of Q1, it is not recommended to setup a view as you mentioned above, it will conduct some unexpected results.
In your case, I suggest you move the custom fields "location" and "owner information" into child post type "Room", then you will be able to setup the filters as what you want.

Again, please create new thread for those new questions, that will help other users to find the answers. thanks

#555465

I got it, I may need to think about it. Thank you so much for the help

#555545

OK, please let me know if you need more assistance.

#556224

🙂

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