• Resolved cmsnext

    (@cmsnext)


    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)
  • Mirko P.

    (@rainfallnixfig)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thanks.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    This thread has been inactive for a bit, so I’m going to mark it as resolved now. Hopefully, the above information was helpful to you!

    Please feel free to open a new thread if you have any further questions.

    Thread Starter cmsnext

    (@cmsnext)

    Hi, No one has been able to help me out on this. Is there no known function or code to do this?

    Hi @cmsnext

    This specific forum is more focused on the default WooCommerce core features. As already recommended, you might get more insights by posting your question on the above channels for developers.

    Cheers

    Thread Starter cmsnext

    (@cmsnext)

    @margaretwporg I think my question is related to a core functionality. We need to sort by meta value of a specific meta key. I think there should be some basic direction on how to achieve this as for my example and project it becomes really important to have the sorting function

    I want to sort by color name + the color group for attributes pa_color.

    Thank you

    Mirko P.

    (@rainfallnixfig)

    Hey @cmsnext,

    Sorting by color name + the color group for attributes pa_color as you mention is custom work since this is not a built-in option in WooCommerce, and would require some coding to make it happen. Custom coding goes beyond the scope of support we are able to provide in this forum.

    I can recommend the WooCommerce Developer Resources Portal for resources to get started on developing for WooCommerce.

    If none of the above-mentioned channels for developers will help you get going, and if you do require more help with the actual coding, we would definitely recommend hiring a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    Thanks.

    Thread Starter cmsnext

    (@cmsnext)

    @rainfallnixfig Thanks. Yes, thats what I am suggesting. Sorting should be inbuilt option for WooCommerce. Even if via some function, there should be an easy to use sorting functionality which seems to be missing as I am not able to find anyone with any kind of code or help for this! I have checked at various locations without any luck.

    Mirko P.

    (@rainfallnixfig)

    Hey @cmsnext,

    WooCommerce already has some default sorting options in the customizer, but not the ones you’re requesting. You could add your suggestion for extra sorting options on our Ideas Board, which is where developers go to look for future plugin features and improvements.

    For the moment, any extra option not included within the default functions needs to be added via plugin/extension or using a custom-coded solution.

    I’m pretty sure that on this URL https://woocommerce.com/customizations/ you will find an agency or expert developer that can provide you a quote for this specific requirement.

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to sort by meta value of attribute’ is closed to new replies.