Order WooCommerce orders by meta field AND date
Hi guys,
I’m working on a WooCommerce store with custom sorting based on a meta field (_shipping_delivery_date). HPOS is not enabled.
All orders are sorted by the meta value (_shipping_delivery_date), for example:
– 06-09-2024
– 06-09-2024
– 06-09-2024
– 07-09-2024
– 08-09-2024
I would like to sort the orders in WordPress by the meta field AND by post_date (order date).
First the orders need to be sorted by the meta value like in my example above. Then I would like to show the newest order of that day first and later orders after.
Sorting by the meta field value works fine, but I can’t figure out how to sort by post_date as second sorting option.
Here is a screenshot of what I would like to achieve: https://qore.digital/screenshots/admin-columns-pro-sorting.png
Hopefully you can help me out! Ps. if needed, I can add a custom function to achieve the sorting.
Thanks in advance!
You must be logged in to reply to this topic.