I have a major problem with this one. Basically when i try to click on product link that is generated from custom product collection (i mean filtered). It SOMETIMES gives me 404 page. The URL is correct. I don't know how to even debug this thing. It's really bumming me out. This is my filtered collection class:

class Mage_Catalog_Block_Product_Featured extends Mage_Catalog_Block_Product_Abstract {

public function __construct() {
    $products = Mage::getModel('catalog/product')->getCollection()
                    ->addAttributeToFilter('featured',array('eq' => 1))
                    ->addAttributeToFilter('status', array('eq' => 1))


More importantly 404 page shows up not all times. Is this some rewrite problem? Because i can open product 100 times and it will open up. But then after some time doing nothing on the page and then click the product it gives me 404 page. That is really really weird..

I'm getting url like this:


Is there a way to fix this? I don't know what i'm doing wrong here. Please help.

1 Answer 1


The products giving 404 error may have set visibility to Not display individually i.e they are associated products and not available to sale individually.

To filter your collection with visibility and Salable product use below code-

Visibility Filter

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

Salable Filter

  • You may be understanding my question wrong. Because 404 is popping up SOMETIMES that means not all times. If products would be not visible individually 404 would pop up every time. Do you have any more ideas? Dec 30, 2016 at 8:30

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.