I want to separate attributes according to product category id on product compare page. means on ../catalog/product/compare/list.phtml
anyone can help me?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to separate attributes according to product category id on product compare page. means on ../catalog/product/compare/list.phtml
anyone can help me?
Try with
$_product = Mage::getModel('catalog/product')->load($_item->getId());
$ids = $_product->getCategoryIds();
$categoryId = (isset($ids[0]) ? $ids[0] : null);
I know that loading a product in a loop may lead to performance issues but how many products can you have in a comparison list? I think it's safe to say, not that many.
$_item
is already a product instance, so $ids = $_item->getCategoryIds()
should work as well. If not, add the missing fields/joins to the collection.
– Fabian Schmengler
Nov 11 '14 at 10:02