How to sort by meta value of attribute
-
I am trying to run a query using get_terms wherein I want to sort by meta value of a specific meta key
I have a product > in that under Attributes I have created Color as attribute. For each color I have added color group 1, 2, 3, 4, 5, 6
Now I want to get_terms and pa_color under which I have pa_color_colorgroup as the meta name. So I tried using the code get_terms orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘pa_color_colorgroup’, ‘order’ => ‘ASC’ but its not working.
I also want to sort by color name + the color group. Any guidance / suggestions on how it can be achieved?
Thank you
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘How to sort by meta value of attribute’ is closed to new replies.