Skip Navigation

[Resolved] WooCommerce Products Archive Ordering not working

This support ticket is created 2 years, 7 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by scottL-3 2 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#2353935

I am trying to:
Order the WooCommerce Products Archive by menu order with title as a secondary sort

Link to a page where the issue can be seen:
hidden link

I expected to see:
Products ordered by the menu order I set for them and when they have the same menu order value, sorted by title.

Instead, I got:
The same order no matter what settings I choose. I've tried clearing and disabling server-side caching. I've tried disabling GeneratePress Premium's WooCommerce module. I tried adding a Toolset custom field to Products and using that to sort. It always presents the products in an order that is not by menu order nor product title. If I set the Toolset Products Archive to sort by title with no secondary sort, that does work. I am baffled as to what might be wrong. I also made a copy of the site and moved it to its eventual live hosting account. All the same problems occur there.

There are no javascript console errors not that I would expect this to be a client side issue.

Is this a known issue?

Note that I am not using Blocks for the Archive Output but I don't think that would matter anyway.

#2354245

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Scott

I've tested this locally and confirm the problem.

It appears to be the same issue under the hood as another issue we have reported, where ordering fails when sorting by a custom field and including a secondary sort order. (This is slightly different, inasmuch as menu_order is a standard field, not custom field.)

I'm going to update the internal ticket we have about this with these details and create an erratum for it.

One thing I did notice, however, is that if I remove secondary sorting and only sort by menu_order, seemingly by coincidence it was secondary sorting by post title, which is what you are aiming for anyway.

Can you check if that works in the meantime?

#2354419

Hi Nigel, nice to hear from you. Yes, the workaround of only setting primary sort on Menu Order with no secondary sort is working with Menu Order and the fallback of alpha by title.

It seems the issue may be related to how WooCommerce implements its override on Product Sort (Appearance -> Customize -> WooCommerce -> Product Catalog -> Default product sorting). I suspect that is fighting with Toolset's sorting settings in the Archive in some way and when we choose only Menu Order, WooCommerce is doing the rest.

We can proceed to launch the site with this workaround. It will be good is development can figure this out so we have more sort options in the future but the issue is now a low priority for us.

#2354523

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Good to know, Scott.

I've updated the internal tickets, and have published an erratum so other users are aware of the problem.

If you want to know when it's fixed, I'd suggest subscribing to that, and we can close here.

https://toolset.com/errata/woocommerce-product-archive-sorting-broken-whenever-secondary-sorting-added/

#2354531

Thanks for helping to find a workaround.