mons / magento-toolbar-sorter
Installs: 573
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: ~8.1.0||~8.2.0
- magento/framework: 103.0.*
- magento/module-catalog: 104.0.*
- magento/module-layered-navigation: 100.4.*
This package is auto-updated.
Last update: 2024-12-28 05:18:09 UTC
README
Customize and optimize the default product listing sort by, include the direction in a single select element.
Installation
- Install module via composer
composer require mons/magento-toolbar-sorter
- Register module
php bin/magento setup:upgrade
Configuration
- Navigate to Stores > Attributes > Product
- Choose the sortable attribute you want to configure
- From the "Storefront Properties" tab, turn on the "Used for Sorting in Product Listing", then choose the behavior from "Product Listing Sorter" (see the options below)
Options
- Default (do not override): use Magento's default sorting setting (normally ascending)
- Ascending: show only the option for ascending (from low to high) order
- Descending: show only the option for descending (from high to low) order
- Ascending + Descending: show both the options above, ascending first
- Descending + Ascending: show both the options, descending first
Theming
This module doesn't override the default template Magento_Catalog::product\list\toolbar\sorter.phtml
, giving you the full control on it.
Anyhow a working sample is provided as Mons_ToolbarSorter::product\list\toolbar\sorter.phtml
.
Tested working with
- Magento 2.4
- PHP 8.1
Contribution
- Fork this repository
- Create your feature branch (
git checkout -b feature/your-new-feature
) or a bugfix branch (git checkout -b bugfix/bug-short-description
) always fromdevelop
- Commit and submit a new Pull Request