Is your feature request related to a problem?
It's been often a request from clients to order the products by stock status so the in stock products will always be listed first.
Describe the solution you'd like
A more ideal way to handle this would be if products orderby would include stock status as a part of the default options.
Describe alternatives you've considered
Been trying two approaches:
Making use of post_clauses hook but that didn't lead to a clean/maintainable solution.
Trying to make use of graphql_woocommerce_products_add_sort_fields hook to update the default options, but with latest updates it seems that it isn't possible anymore.
Is your feature request related to a problem? It's been often a request from clients to order the products by stock status so the in stock products will always be listed first.
Describe the solution you'd like A more ideal way to handle this would be if products
orderby
would include stock status as a part of the default options.Describe alternatives you've considered Been trying two approaches:
post_clauses
hook but that didn't lead to a clean/maintainable solution.graphql_woocommerce_products_add_sort_fields
hook to update the default options, but with latest updates it seems that it isn't possible anymore.