wp-graphql / wp-graphql-woocommerce

Add WooCommerce support and functionality to your WPGraphQL server
https://woographql.com
GNU General Public License v3.0
633 stars 123 forks source link

Order products by stock status #824

Closed Nessario closed 6 months ago

Nessario commented 6 months ago

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:

kidunot89 commented 6 months ago

@Nessario The function that calls that hooks is no longer in used and new one with have to be added here.

With that hook, you would just have to register a new enumeration value to this type using the hook in the linked code, and you should be all good