Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Magento Compare issue. 
Jr. Member
Total Posts:  1
Joined:  2012-03-22


First I want to say that Magento is a great platform for E-commerce. I use it for all of my projects and I am really glad when developing extensions for this great platform.

I have a small issue with the compare function. When i call it in a extension not in the list.phtml file like this:
“ <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
<li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>” class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
<?php endif; ?>”
,it gives me an error “exception ‘Mage_Core_Exception’ with message ‘Invalid block type: Mage_Catalog_Block_Category’”.
I can`t guess why because my products are listing in the category and everything else works fine except the compare function.
Also another thing that I have notices is that on the list.phtml and on my extension(which loads with AJAX btw… i don`t know if this matters. It loads on the list.phtml with AJAX and replaces the products listing in grid mode) is that this same function gives different URLS for the compare link. Is this a problem?

Is there any security setting or XML configuration which perhibits compare function form external files in magento?
Is it normal the same function for the same URL to give me two different URL`s?

Basically this is my main problem.

Thank you all for your support!!

Wish you all the best!

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top