I have added following code to change the collection. The issue is that when I print the sql query then I am getting correct result(in mysql ) but after that when I print getData on collection then the products are different.
- Can someone please guide me on it?
Thanks
$collection->addAttributeToSelect('fan_motor_height_blades', 'catalog_product_entity_varchar');
$zeroPriceLast = new \Zend_Db_Expr("fan_motor_height_blades = 0.000000 ASC, fan_motor_height_blades ASC");
$collection->getSelect()->order($zeroPriceLast);
//echo $collection->getSelect()->__toString();die();
echo '<pre>';print_r($collection->getData());die();
fan_motor_height_blades
= '0.000000' ASC,fan_motor_height_blades
ASC"); $subject->getCollection()->getSelect()->reset(\Zend_Db_Select::ORDER)->order($zeroPriceLast);