How can i hide empty attributes from compare product? is it possible ? if yes how ? For better understanding i attached image please look in it.
Thank you in advance.
How can i hide empty attributes from compare product? is it possible ? if yes how ? For better understanding i attached image please look in it.
Thank you in advance.
I think you can achieve this by editing the .phtml file that is generating this view. I suggest that you enable template hints (http://help.sweettoothrewards.com/article/434-how-do-i-turn-on-template-path-hints) to locate which file to change.
Then you just need to check, if the attribute is empty do not display it, something like this could work:
if (!empty($product->getData('your_attribute_here'))) {
echo $product->getData('your_attribute_here');
}
If the file that is generating this view is a magento core file, do not hack it, instead create your own .phtml for this in one of your modules. Check this answer: https://magento.stackexchange.com/a/16205/5913 for details on how to do this.
We have add done this in the list.phtml and is working fine:
New line 93
<?php if (!is_null($_item->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_item) != '')): ?>
New line 120
<?php endif; ?>
If one of all compared product have something inside the attribute, the line while appear, but you can change "no" in mage_catalog.csv and add "N/A"
Work with Magento 1.9 to 1.9.2.4