Skip to content

sorting

Auto Added by WPeMatico

Magento 2 – Custom sort order not working properly

I have created a custom plugin for sorting options for high to low & low to high price. High to low sort works fine but “low to high” sort order not showing correct results. app/code/Digital/CustomSort/etc/di.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”>… Read More »Magento 2 – Custom sort order not working properly

Sorting custom columns from module that extends another module containing all the data (collections, data providers, etc.)

I have two custom columns in UI grid (let’s call them subscribed_customers” and “unique_purchases”) created in particular listings that retrieve value from the database with logic. Working well so far. The issue is that I’m unable to sort them in… Read More »Sorting custom columns from module that extends another module containing all the data (collections, data providers, etc.)

How to sort products in Magento by new from date?

I wanted to sort products by new from date , please see the query but it is not working perfectly $collection->getSelect() ->joinLeft( [‘catalog_product_entity_datetime’ => ‘catalog_product_entity_datetime’], ‘e.entity_id = catalog_product_entity_datetime.entity_id AND catalog_product_entity_datetime.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = “news_from_date” LIMIT… Read More »How to sort products in Magento by new from date?