Skip Navigation

[Resolved] Sort products by date (custom field)

This support ticket is created 4 years, 5 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 3 voices.

Last updated by mattheww-11 4 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1739643
screenshot2.jpg
screenshot1.jpg

Hi. I'm picking up on a past support ticket that I had started last spring:
https://toolset.com/forums/topic/sort-products-by-year/

I'm looking to sort products by date, which is a 4-digit year. I had originally tried to sort using a custom taxonomy. I have since duplicated the dates into a custom field: "year-4sorting." (screenshot1). When I set my product view to order by year (screenshot2), no results display.

Here's an example of a products page where I would like to fix my sorting issue:
hidden link

Thanks for your help,
mw

#1740225

Hello mw and thank you for contacting the Toolset support.

The sorting configuration on the view seems correct to me, it should work. Maybe there is something interfering with the view such as:
1. Caching: Purge any cache and ask your hosting provider to purge any server-level caching(Redis, Memcache, Varnish, etc.).
2. Compatibility conflict: check if this issue appears when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty Fourteen. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at the time to track where the incompatibility is produced.

If this does not help, please allow me temporary access to your site to check this page closely. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1741549

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Jamal is on Vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.

The thing is that the custom field "year-4sorting" was not a types field. So, I navigate to:
=> Toolset => Custom Fields => click on "Post Field Control" button and on the screen you get you will see all the field.

I set the field "year-4sorting" to manage with Types plugin.
=> hidden link

Then I set your view to sort by the custom field "year-4sorting".
=> hidden link

Can you please confirm if it works as expected.
=> hidden link

#1742209

This solves my problem. Thanks very much.

I do have one further question though:

In Edit View > Ordering > Order by, there are several instances of the field "year-4sorting." How do I delete that ones that I don't need / don't exist anymore? I tried post field control, but there is only one "year-4sorting" there.

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

https://toolset.com/forums/topic/split-sort-products-by-date-custom-field-remove-duplicate-custom-fields/

#1743077

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Great - good to know that solution I shared help you to resolve your issue.

I've created a new ticket from your another question and will handle with the following brand new ticket.
=> https://toolset.com/forums/topic/split-sort-products-by-date-custom-field-remove-duplicate-custom-fields/

Please feel free to mark resolve this ticket.

#1743341

My issue is resolved now. Thank you!