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 magento.stackexchange.com, 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 community@magento.com.

Magento Forum

Compare Block is duplicated
 
brunocortes06
Jr. Member
 
Total Posts:  1
Joined:  2013-02-02
 

Hi, anyone help me to resolve this problem? my compare block are duplicate, a see that is called by the same place but i dont find where it call 2 times.

Image Attachments
dup.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
brunocortes06
Jr. Member
 
Total Posts:  1
Joined:  2013-02-02
 

this is my sidebar.phtml

<?php 
$_helper 
$this->helper('catalog/product_compare');
$_items $_helper->getItemCount() > $_helper->getItemCollection() : null;
?>
<div class="block block-list block-compare">
    <
div class="block-title">
        <
strong><span><?php echo $this->__('Compare Products'?>
            <?php 
if($_helper->getItemCount() > 0): ?> 
                
<small><?php echo $this->__('(%d)'$_helper->getItemCount()) ?></small>
            
<?php endif; ?>
        
</span></strong>
    </
div>
    <
div class="block-content">
    
<?php if($_helper->getItemCount() > 0): ?>
        
<ol id="compare-items">
        
<?php foreach($_items as $_index => $_item): ?>
            
<li class="item">
                <
input type="hidden" class="compare-item-id" value="<?php echo $_item->getId() ?>" />
                <
a href="<?php echo $_helper->getRemoveUrl($_item) ?>" title="<?php echo $this->__('Remove This Item') ?>" class="btn-remove" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the compare products?') ?>');"><?php echo $this->__('Remove This Item'?></a>
                <
class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item$_item->getName(), 'name'?></a></p>
            </
li>
        
<?php endforeach; ?>
        
</ol>
        <
script type="text/javascript">decorateList('compare-items')</script>
        
<div class="actions">
            <
a href="<?php echo $_helper->getClearListUrl() ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove all products from your comparison?') ?>');"><?php echo $this->__('Clear All'?></a>
            <
button type="button" title="<?php echo $this->__('Compare') ?>" class="button" onclick="popWin('<?php echo $_helper->getListUrl() ?>','compare','top:0,left:0,width=820,height=600,resizable=yes,scrollbars=yes')"><span><span><?php echo $this->__('Compare'?></span></span></button>
        </
div>
    
<?php else: ?>
        
<class="empty"><?php echo $this->__('You have no items to compare.'?></p>
    
<?php endif; ?>
    
</div>
</
div>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Lyonscg
Sr. Member
 
Avatar
Total Posts:  173
Joined:  2009-11-13
Chicago IL
 

I would guess you or someone else modified one of the xml files and possibly added a second reference to the compare block. You need to add <action method="unsetChild"><name>BLOCK_NAME</name></action> just before the added reference to remove the original.

What I don’t understand though is why the second reference is even being used at all. I don’t see a difference between the two blocks.

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