Skip to content

Sorting

danneg edited this page Jun 14, 2023 · 2 revisions

In order for the API request to happen, the ApiSortingModelInterface dependency that has to be declared.

About

The ApiSortingModelInterface is used:

  1. in the API RequestTransformer in order to set/validate the sorting rule for the request.
  2. 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:

  1. ApiSorting model
  • 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
  1. ApiSortingOption model

Integration

  1. Declare the DI preference
  2. Identify the desired frontend sorting options
  3. Identify the Boxalino fields required for as data-source
  4. Add the sorting options as arguments to the model.