[Resolved] Filter by date range or price range

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.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

This topic contains 12 replies, has 2 voices, and was last updated by  Jeffrey 1 month, 2 weeks ago. The support staff assigned to this topic is Luo Yang.

Viewing 13 posts - 1 through 13 (of 13 total)
Author
Posts
#547724

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

I visited this URL: https://wp-types.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

Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

Dear jianfeng,

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

But the thread you mentioned above:
https://wp-types.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

Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

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

Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

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

#551174

Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

I assume we are talking about the custom numeric field "Monthly rate(USD)":
https://www.your-domain-name.com/wp-admin/admin.php?page=wpcf-edit&group_id=13
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:
https://www.your-domain-name.com/wp-admin/admin.php?page=views-editor&view_id=56445
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:
https://www.your-domain-name.com/add-two-fields-to-filter-by-min-monthly-fee-and-max-monthly-fee/

for example 3000~4000:
https://www.your-domain-name.com/add-two-fields-to-filter-by-min-monthly-fee-and-max-monthly-fee/?wpv_view_count=56445-TCPID56446&wpv-wpcf-monthly-rateusd_min=3000&wpv-wpcf-monthly-rateusd_max=4000&wpv_filter_submit=Submit

#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

Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

Yes, you can query the child "room" posts, and display the parent "host" information, see our document:
https://wp-types.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

https://www.booking.com/searchresults.html?label=gen173nr-1FCAEoggJCAlhYSDNiBW5vcmVmcgV1c193YYgBAZgBMsIBCndpbmRvd3MgMTDIAQzYAQHoAQH4AQuSAgF5qAID;sid=19e500a049fee23f253ecc8cf127545f;checkin_month=7&checkin_monthday=29&checkin_year=2017&checkout_month=8&checkout_monthday=3&checkout_year=2017&class_interval=1&dest_id=20088325&dest_type=city&dtdisc=0&group_adults=2&group_children=0&inac=0&index_postcard=0&label_click=undef&no_rooms=1&offset=0&postcard=0&room1=A%2CA&sb_price_type=total&search_pageview_id=342d8f6c05b303e0&src=index&src_elem=sb&ss=New%20york&ss_all=0&ssb=empty&sshis=0&

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

Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

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

Luo Yang
Forum moderator

Supporter languages: English (English ) Chinese (Simplified) (简体中文 )

Supporter Timezone: Asia/Hong_Kong (GMT+08:00)

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

#556224

🙂

Viewing 13 posts - 1 through 13 (of 13 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Known issues and their solutions

We document known issues and their solutions in Toolset erratas. Save time by checking there first and seeing if what you are facing is a known issue. This list is kept short. We do our best to resolve all known issues with every release of Toolset plugins.

Support Policy

Toolset staff will help you use the Toolset plugins correctly, provide any information you need, help troubleshoot problems and advice on best-practices.

Please make sure to issue only one topic per each support ticket.

For more information, read our full Customer Support Policy.

Need custom programming work for your site? Check out our certified partners.