Showing results for 
Search instead for 
Did you mean: 

Attributes order in comparison window is wrong!


Attributes order in comparison window is wrong!

Set up your attributes order in "Attributes set" as you wish to be listed in frontend (product page and compare window). In product page attributes are listed in correct order (Additional information section). Now add this product to compare list. Compare it.


Attributes order should be the same like you set it up in "Attribute set" and same like in Additional information. In compare window attributes are in a different order. This need a fix since is a bug. Maybe a global position that can be changed for an attribute could solve elegant this issue. There is a position field but for Layering Navigation only.


Re: Attributes order in comparison window is wrong!



Please have look at this post, I think you will be able to find the solution for the sort order on the compare (of attributes).

Maybe this module, alså could help you:

The module is free, and you could use parts of it, to fit you needs:


-- Best regards --
Kent Christiansen / @KentChrDK / Magento Certified Solution Specialist / Visit my site (DK)

Re: Attributes order in comparison window is wrong!



This is how I solved the problem. Override this file








Around line 220, find "public function getComparableAttributes()"

Comment the original function and replace it with the following code


/** Function overridden by nadshez to fix sort order in comparison list */
	public function getComparableAttributes()
        if (is_null($this->_comparableAttributes)) {
            $this->_comparableAttributes = array();
            $setIds = $this->_getAttributeSetIds();
            if ($setIds) {
                $select = $this->getConnection()->select()
                    ->from(array('main_table' => $this->getTable('eav/attribute')))
                        array('additional_table' => $this->getTable('catalog/eav_attribute')),
                        array('al' => $this->getTable('eav/attribute_label')),
                        'al.attribute_id = main_table.attribute_id AND al.store_id = ' . (int) $this->getStoreId(),
                        array('store_label' => new Zend_Db_Expr('IFNULL(al.value, main_table.frontend_label)'))
						array('ai' => $this->getTable('eav/entity_attribute')), 
						'ai.attribute_id = main_table.attribute_id'
                    ->where('additional_table.is_comparable=?', 1)
					->where('ai.attribute_set_id IN(?)', $setIds)
					->order(array('ai.attribute_group_id ASC', 'ai.sort_order ASC'));
                $attributesData = $this->getConnection()->fetchAll($select);
                if ($attributesData) {
                    $entityType = 'catalog_product';
                        ->importAttributesData($entityType, $attributesData);
                    foreach ($attributesData as $data) {
                        $attribute = Mage::getSingleton('eav/config')
                            ->getAttribute($entityType, $data['attribute_code']);
                        $this->_comparableAttributes[$attribute->getAttributeCode()] = $attribute;
        return $this->_comparableAttributes;

That's it. Hope this helps. Thanks.

Re: Attributes order in comparison window is wrong!

@nadshez Sorry for my late reply. Thank you for your solution. I tried ET Advanced Compare before but it is using AJAX and creates trouble with Varnish. Yours works great, so far so good. I posted a bug ticket into Magento list for fixing this in next releases. It is a bad programming logical to get in product page a sorting order then in comparison windows other sorting order.

From ET Advanced Compare I will take the idea of creating an attribute to disable adding a product into comparison list. It is just an if statement in products list and product view page.