In a custom post type (products) I want to order products by summing multiple values based on user selection. I use custom taxonomies to filter the products.
I could use the orderby
meta_value but the combinations a user could make are so many that it's not possible to store all these totals as post meta.
I think I will need to alter the wp query using filters like
posts_clauses. Could a custom SQL query handle this effective (or maybe a different approach)?
It's a custom setup so I don't mind how the values are stored. Could be as post meta, in a custom table or even as a json/string in the
post_content field (I don't make use of it).