Magento Sort Attribute by Decimal not Alphanumerically

后端 未结 6 1690
刺人心
刺人心 2021-02-05 22:08

So I\'ve Googled like crazy to try and find a solution to this problem that actually works properly but have come up empty handed.

When using the Sort By function on a

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 22:28

    For default sort order:

            // Start of Code to force Magento to numerically sort decimal attributes rather than alphabetically
            $filterAttribute = Mage::getBlockSingleton('catalog/product_list_toolbar')->getCurrentOrder();
            //$filterAttribute = $this->getRequest()->getParam('order');
            $filterAttributeDir = Mage::getBlockSingleton('catalog/product_list_toolbar')->getCurrentDirection();
            //$filterAttributeDir = $this->getRequest()->getParam('dir');
    

提交回复
热议问题