I have a plugin for the afterSetCollection method, which is hung on the MagentoCatalogBlockProductProductListToolbar -> setCollection method. But for some reason, sorting occurs by the price, color and others fields, but by the field in the discount model object, sorting does not occur. But nevertheless, products with this filtering parameter are displayed on the page. What could be the problem?
$collection->setOrder('price', 'desc'); - Work
$collection->setOrder('color', 'asc'); - Work
$collection->setOrder('discount', 'asc'); - Does not work