Skip Navigation

[Resolved] Search by date metafield BIS

This support ticket is created 6 years 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by bouchairY 6 years ago.

Assisted by: Christian Cox.

Author
Posts
#631427

Hello Beda

As it was mentionned before, I'm trying to search in repeatable acf pro metafields.

I have found a workaound :

Instead of searching repeatable acf metafields, we have convert these repeater sub fields to standard WP meta fields and then to search the posts using these converted values (meta key is not unique and can have more then one value : using with last parmeter as "false" : add_post_meta($post_id, $meta_key, $color, false);)

I have a travel cpt with some offers attached to it (using the repeatable fields)

TRAVEL1 has 2 offers attached to it
offer1 : expiry date : date1 , attributs : yoga, kids
offer2 : expiry date: date2, attributs : family,sport,spa

If I search with using next criterias :

date= expiry date1 and attributs = kids, the search return TRAVEL1 wich is correct

but when we search :

date= expiry date1 and attributs = spa, the search also return TRAVEL1

wich is not very correct !

Thank you

#631429

Hello
Just discovered also a new issue

When searching by checkboxes, Nigel suuggested to use the LIKE operator, this iw working if when 1 checkbox is checked, but if i check 2 checkboxes it is not working
(search is done on astrandard wp metafield where values are store as comma separated values

Thank you

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/how-to-filter-by-more-than-one-checkbox/

#631580

Hello, I split your second question into a new ticket. Our support policy is to address one question per ticket, so please keep that in mind in the future and create separate tickets for each problem. This helps us keep things organized.

I have a travel cpt with some offers attached to it (using the repeatable fields)
I'm not sure what this means. Are Offers a child post type of Travel, or a repeating field group (in M2M beta plugins)? Could you show me a screenshot of the Travel CPT editor screen in wp-admin? I would like to see how Offers and these custom fields are configured.

If I search with using next criterias :
Are you talking about searching with a custom search View, or a Query Filter with filter values predefined, or a custom WP_Query, or what? If it's a View, show a screenshot of the View editor screen. If it's a custom WP_Query, provide the code for the query.

#632050

Thank you

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