/** * Compare attribues sorting * * @param Mage_Catalog_Model_Entity_Attribute $attribute1 * @param Mage_Catalog_Model_Entity_Attribute $attribute2 * @return int */ public function attributesCompare($attribute1, $attribute2) { $sort1 = $attribute1->getGroupSortPath() * 1000 + $attribute1->getSortPath() * 0.0001; $sort2 = $attribute2->getGroupSortPath() * 1000 + $attribute2->getSortPath() * 0.0001; if ($sort1 > $sort2) { return 1; } elseif ($sort1 < $sort2) { return -1; } return 0; }