-
- Notifications
You must be signed in to change notification settings - Fork 143
Closed
Milestone
Description
In most cases i need to sort products by name field, but that's not actually possible.
I suggest to add sorting by NAME in type ProductOrderByEnum using wordpress database table column post_title.
Following a sample code for explain my idea under post_type_values() method in file includes\type\enum\class-post-type-orderby-enum.php:
'NAME' => array( 'value' => 'post_title', 'description' => __('Order by name', 'wp-graphql-woocommerce'), )This is result in products query ordered by product name
query SortProducts { products(where: {orderby: {field: NAME, order: ASC}}) { nodes { id name } } }kidunot89
Metadata
Metadata
Assignees
Labels
No labels