mediaman / module-product-category-sort-order
Magento 2 module that provides a sort order for category position
Installs: 56
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: >=7.0
- magento/framework: 100.*
- magento/module-catalog: 101.*
- magento/zendframework1: ~1.12.16
Requires (Dev)
- phpstan/phpstan: ^0.7.0
- phpunit/phpunit: 4.1.0
- squizlabs/php_codesniffer: ^3.0
This package is not auto-updated.
Last update: 2020-01-24 16:50:20 UTC
README
Provides a sort order for category position.
The default Magento2 /rest/V1/products
REST API endpoint does not allow to sort by products category position.
This module addresses this problem by plugging in seamlessly into the Magento2 API.
Getting Started
Install the module via composer
$ composer require "mediaman/module-product-category-sort-order: 1.*"
Enable the module
$ ./bin/magento module:enable Mediaman_ProductCategorySortOrder
Upgrade your Magento database schemas
$ ./bin/magento setup:upgrade
Usage
You can use the /rest/V1/products
endpoint as you normally would:
$ curl -X GET http://magento.example.com/rest/V1/products?
searchCriteria[filterGroups][0][filters][extension_attributes][field]=category_id&
searchCriteria[filterGroups][0][filters][extension_attributes][value]=42&
searchCriteria[filterGroups][0][filters][extension_attributes][conditionType]=eq&
searchCriteria[sortOrders][0][field]=position&
searchCriteria[sortOrders][0][direction]=ASC
--header "Authorization: Bearer pbhercbtk6dd3eatf1pyx8jj45avjluu"
License
MIT © mediaman GmbH