Forums Forums Search & Filter Pro Cannot find results using date on post meta

Viewing 10 posts - 1 through 10 (of 10 total)
  • Anonymous
    #255182

    Hi there,

    We are using a combination of fooEvents and WooCommerce to create an event shop.

    Using the post meta field we can grab ‘WooCommerceEventDate’ which is the event date.
    If we use the choice selector at the top, we can get the drop down options automatically with the dates stored in the product and this works. I believe this checks as YYYY-MM-DD for the value.

    However this is not user friendly as there will many dates of courses, hence why we need the date option at the top which uses a datepicker as its input. We no longer will receive any results from this date picker as i am guessing it is submitting the value as something different to YYYY-MM-DD hence the query not working.

    Any light you could shed would be fantastic.

    Cheers,

    Richard

    Trevor
    #255197

    I suspect that the datepicker is expecting the dates to be stored as YYYYMMDD (which is the standard SQL date format).

    Are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #255221

    This is what I am suspecting, but I have tried editing the query string in the browser even and still nothing…

    The other post meta search fields work nicely as we have Relevanssi installed to use the custom search fields.

    Cheers,

    Richard

    Trevor
    #255256

    Can I ask you to update Search & Filter to v2.5.1 first? MAKE A FULL BACKUP of the site first.

    You will need to download it from Your Account, then delete the current version from plugins (I have checked, and nothing will be lost). The install the new version. WordPress will not offer the update, as we have a new server and this old version does not recognise it.

    Let me know when you have done this?

    Anonymous
    #255266

    All updated there. We are working off a preview site for testing purposes so when we need to use the updated plugin on the live site, i assume we can just delete the plugin from our test site and install on the live site?

    Cheers,

    Richard

    Trevor
    #255294

    For a WooCommerce form, the Ajax Container will almost always need to be .products, and this is so for your site.

    I have looked in to the database and there are two dates that are stored very wrongly. That MIGHT be the issue.

    The alternative might need to be to create a second date field, where you can use the WordPress autosave function to take the date that the plugin stores, and re-format that and save it into this second field in the correct format. This post should give you some ideas on that (this example save only the year, but the idea is the same):

    https://support.searchandfilter.com/forums/topic/datefilter/page/3/#post-238869

    Anonymous
    #255376

    Hi Trevor,

    We have looked into to your solution and have made a small test that will work.

    I changed those values in the meta for testing purposes.

    We will indeed take the foo events dates, translate them to YYYYMMDD and store it in a new custom field and then search for that using post meta.

    Let us make sure this has worked, and have it working on the live site before closing the topic.

    I will then remove your temp account on the site.

    Cheers

    Trevor
    #255378

    OK. I will wait to hear back from you.

    Anonymous
    #256559

    Hi Trevor,

    We have this working on our live site now, thank you for your help.

    Cheers

    Trevor
    #256561

    That’s great to hear. I will close this thread for now.

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