I wouldn’t use taxonomies or custom fields for this purpose. Every time you’re add one custom field for a query, you have to add a JOIN part for that query – it means that with 10-15 custom fields, you’ll get query with 10-15 joins – so such query will be very slow.
But there is some nice trick you can use in such case. I would approach it this way:
- Create custom DB table with a column for every property that can be included in sum. (So there should be one external key
post_id
which will allow you to join this table with posts table and then one column for every property – sobasic_cost
,extra_cost
,extra_cost_2
and so on – or whatever your properties are…) This way you’ll be able to use these columns in a sum and the query will need only one join. - Use
save_post
hook to fill that table with meta values. - Use
posts_clauses
hook to join your custom table and order by whatever sum you want based on fields in that table.