Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Patrick Heiloo

Order WooCommerce orders by custom date

I have a question about ordering WooCommerce orders by a custom date value. We would like to order the WooCommerce orders by date ‘today’ AND by upcoming dates in the future. Is it possible to apply a AND operator for filter by today AND dates in the future?

10 months, 2 weeks ago
Stefan van den Dungen Gronovius
Developer

Do I understand you correctly that you have a custom field for orders that contains an upcoming date and you want to filter orders that have ‘created’ date on today AND with the custom field set to dates in the future?

The name ‘Upcoming dates’ suggest that they are always in the future :)
All our filter logic work as an AND operator so if you have two filters and both conditional match, you should be able to filter the order based on your use case.

10 months, 2 weeks ago
Patrick Heiloo

Hi Stefan, thanks for your reply. No, that is not the case. I’ll try to explain it more clearly:

We added a custom field for the preferred delivery date for an order. You can pick the delivery date with a datepicker as a customer during checkout. The value is stored as WooCommerce order meta after the order is placed.

We would like to order all orders within WordPress by this custom date value (ASC), starting with delivery date ‘today’ and all orders in the upcoming future. All orders before ‘today’ must be excluded.

How do we achieve this within the filtering settings of the plugin?

10 months, 2 weeks ago
Stefan van den Dungen Gronovius
Developer

When you have set up the column with the Custom Field column with field type set to date, you should be able to filter all posts based on a relative date, like in the future. But I expect it does not show items that are today based on the format that is stored for that field.

Otherwise, you could filter on posts where the date is after ‘Today’ and select ‘Today’ manually. The downside to this method is that you’ll need to change the date each day.

When you have the desired filter method, you can use sorting to order the dates from today to the future.

10 months, 2 weeks ago

You must be logged in to reply to this topic.