Forums › Forums › Search & Filter Pro › Product property (taxonomy) checkbox sort order
Tagged: V3
- This topic has 9 replies, 2 voices, and was last updated 4 years, 4 months ago by
Anonymous.
-
Anonymous(Private) November 30, 2020 at 8:58 am #268143
Hi,
I can’t seem to find the right sort order for the filter terms in a WooCommerce product property (taxonomy).
I rearranged the property order manually (custom – default woocommerce functionality) but the order of the checkboxes doesnt change in the filter on frontend.
Is there a way to use a filter/hook to order them like they’re ordered in the backend?
Thanks
Trevor(Private) November 30, 2020 at 3:04 pm #268202Not as such. If data terms are stored as a taxonomy (product category is a taxonomy), they cannot be sorted, as taxonomy data are stored as serialized data (multiple terms, like an array) per post (which term in the array would you sort by?). Even if only one term per post is used, WordPress still stores them like this.
You MIGHT be able to do what you want with PHP, but I am not sure if it is possible. You would have to use that PHP in this filter:
https://searchandfilter.com/documentation/action-filter-reference/#filter-input-object
Anonymous(Private) December 3, 2020 at 9:41 am #268584What filter can I use to add data property or edit the html of the checkbox list?
That way I can add sort order and sort with jQuery…
Example: http://jsfiddle.net/Afbrt/
-
AuthorPosts