Tell us what you are trying to do? Add a sort by price to a page
The problem is at hidden link
I see in the url it gives ?wpv_view_count=26043&wpv_sort_orderby=field-views_woo_price&wpv_sort_order=asc&wpv_sort_orderby_as=string
If I change that to wpv_sort_orderby_as=numeric it works.But I don't know how to make that happen.
Hi, I see the issue you are describing and I'm asking my 2nd tier team for some additional feedback. I see there is no way to modify the sorting algorithm in the Block Editor configurations for the Sorting block, and I'm asking for the best workaround. Please stand by and I will give you an update when I have some additional information.
I have been informed by our developers that there is a feature pending for Blocks that will allow you to choose the sorting algorithm for each Sorting block. Right now, the algorithm is "alphabetic" by default, but that does not allow you to sort on the front-end by price as a number. The new feature will allow you to choose a numeric sort, which will accurately sort by price as a number. I'll be glad to keep you updated here in this ticket as I learn more about this new feature development schedule.
Can they give any indication of timescale? It's a fairly important failing. In the meantime is there perhaps a function that can implemented?
I have no idea of the timescale yet, beyond the current release (today's releases) those priorities have not been established. In the meantime, the only workaround I know of is to go to Toolset > Custom Fields and scroll down to click the Post Field Control button. Then you can find the views_woo_price field and change that field type to "number". That should solve the problem you described, but may impact other areas where price is sorted alphabetically. Therefore, use this workaround with caution.
Yep! That fixed it. I'll check for side-effects but really I can't think of a case where I will wan to use price as a string (famous last words).
Best wishes,
Lal
My issue is resolved now. Thank you!
Quick update - the numeric sorting option for numeric field filters like Price will included in the upcoming Blocks 1.4 / Views 3.4 releases.