Skip Navigation

[Resolved] Use a Custom Field (Time Slot) for Secondary Sorting

This support ticket is created 6 years, 2 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 2 months ago.

Author
Posts
#1108529

Hello, I have set up a staging website at staging1.orderpantry.com to test some major overhauls to the Kitchen Display Screen I built on the live website using Toolset Views. The site is running Toolset Types 3.0, Toolset Views 2.6, and WordPress 4.9.8.

The primary change is the replacement of our delivery management plugin to Tyche Software's Order Delivery Date Pro for WooCommerce. In this plugin, I want to manage delivery time as time slots of 30 minute range (Ex. 11:30 AM - 12:00 PM).

For the View's primary sorting, I'm using the delivery date field from the plugin. I want to use the time slots for secondary sorting.

The end of the time slot doesn't matter, it'll be sorted based on the starting time.

I understand there's multiple tickets about this particular case (using custom fields for secondary sorting) and there's documentation, but this is somewhat urgent. If anyone can provide a guide on how to write the Views filter hook for it, that'd be great.

And I'd like to see this as a feature in future updates. I think there's already requests for it.

Thank you!

#1108800

One cannot order by custom fields in the Secondary Sorting option of the Views Ordering Settings.

The feature to allow this is requested, please upvote it to show it's importance to the Developers:
https://toolset.com/feature-request/?wpv_post_search=sort+by&wpv_view_count=686737&wpv-wpcf-plugins=Views
Allow Custom Fields in Secondary Sorting

Now, your case needs particular testing after the above feature is implemented, as it is a Custom Field of a Third Party, but if that Custom Field is stored by the WordPress Codex guidelines then Toolset Views is able to read it you could (once implemented) order by it in the Secondary Sorting option.

Right now, this is not possible.

Regarding the Custom Code to make this possible, you can refer to this post:
https://toolset.com/forums/topic/need-help-with-a-secondary-orderby-on-a-view/#post-415478

It explains (within Toolset Support's Limits) what you can do.