Skip to content

SortingOptions — Sorting Options for Product Lists

Extension for Magento 2

User Manual


CopeX GmbH
Web: https://copex.io
Email: office@copex.io


Table of Contents

Section Page
1 Requirements 2
2 Configuration 2
3 Features 2
3.1 Available Sorting Options 2
3.2 Sorting Logic 3

1 Requirements

  • Magento 2.3 or higher (compatible with 2.4)
  • PHP 8.1 or higher
  • Hyvä Theme or Luma Theme

2 Configuration

This module has no backend configuration. After installation, the sorting options are replaced automatically.


3 Features

3.1 Available Sorting Options

The module replaces the default Magento sorting options (Name and Price) with explicit ascending and descending variants. The following options are available in the sort dropdown on category pages:

Sort Option Direction Description
Name: A to Z Ascending Sort products alphabetically by name (A first)
Name: Z to A Descending Sort products alphabetically by name (Z first)
Price: Low to High Ascending Sort products by price (cheapest first)
Price: High to Low Descending Sort products by price (most expensive first)

The default Magento options Name and Price (without direction) are replaced by these explicit variants.

3.2 Sorting Logic

The module applies the selected sort option directly to the product collection:

  • Name ascending (name_asc) — Sorts by name ASC
  • Name descending (name_desc) — Sorts by name DESC
  • Price ascending (price_asc) — Sorts by price ASC
  • Price descending (price_desc) — Sorts by price DESC
  • Default case (no option or unknown option) — Sorts by position DESC

The override is implemented via a plugin on the Magento Toolbar class that runs the standard sort logic and then applies the ordering based on the selected option. All other Magento toolbar functions (pagination, page size, etc.) remain unchanged.


License

Proprietary — CopeX GmbH. One license per production Magento instance. Test and development environments do not require an additional license.