Get “Sort by” method in catalog page
-
30-03-2021 - |
Solution
You can do it like :
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productList = $objectManager->create('Magento\Catalog\Block\Product\ProductList\Toolbar');
$order = $productList->getCurrentOrder();
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange