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!