Sorting - boxalino/rtux-integration-magento2 GitHub Wiki
In order for the API request to happen, the ApiSortingModelInterface dependency that has to be declared.
About
The ApiSortingModelInterface is used:
- in the API RequestTransformer in order to set/validate the sorting rule for the request.
- for the Sorting block, that manages the sorting options available on the store frontend.
In the framework repository is provided the structure which is used:
- it is used as a "model" property on the sorting Boxalino Layout Block.
- it covers the accessor for bx-sort, which has access to active sort and the sorting options
- used for creating sorting options available for the integration
Integration
- Declare the DI preference
- Identify the desired frontend sorting options
- Identify the Boxalino fields required for as data-source
- Add the sorting options as arguments to the model.