0

Some products are duplicate in my homepage. Only name and descriptions are same. No image is showing for the duplicate record. And when I move cursor over it then the link redirects me to 404 Page . In the backend(admin) when I search that duplicate product by its link(name) then I found nothing.
For ex:- In the backend a product has following...

Product name:- Powerlock 3m/10ft 0-523
id :- 311 SKU :- STA033523
Website :- abc.com

Product name:- Powerlock 3m/10ft 0-523
id :- 12 SKU :- STA033523 Amazon
Website :- abc.com

In frontend :-

$storeId = Mage::app()->getStore()->getId();
$_productCollection=Mage::getResourceModel('catalog/product_collection')
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('is_featured', 1)
    ->addAttributeToFilter('status', 1)
    ->joinField('value','catalog_product_entity_tier_price','value', 'entity_id=entity_id','{{table}}.website_id='.$storeId, 'left')
    ->setPageSize(9)
    ->setStoreId($storeId)
    ->addStoreFilter($storeId);  
<?php foreach ($_productCollection as $_product): ?>
        <a href="<?php echo $_product->getProductUrl(); ?>" title="<?php echo $_productNameStripped; ?>">
            <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(180); ?>" alt="<?php echo $_productNameStripped; ?>" />
        </a>   
<?php endforeach; ?>

It was good . But suddenly today it shows duplicate.No changes has done.

I can't understand how to solve this issue ?
Kindly suggest how to deal with it ?
Thanks.

2
  • Re-indexing and clear cash to admin end
    – Abdul
    Commented Nov 30, 2015 at 13:22
  • @Abdul I have done this already. Kindly look into the updated information. Commented Nov 30, 2015 at 13:43

1 Answer 1

0

I solved it by adding the visibility filter to the collection..

$collection->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.