I want to exclude product who has specific attributes in category product listing page.

I have created one attribute product_disble_listing. if product_disble_listing set yes to product that product not show in listing page. override below block in custom module.


and I have added below code in custom module.

$this->_productCollection->addAttributeToFilter('product_disble_listing', array('neq' => 1));

product collection show correctly but product count, pagination, price filter, color attributes are showing wrong data.

1 Answer 1


I have resolved it. I have added just below code.

$this->_productCollection->addAttributeToFilter('product_disble_listing', array('neq' => 1));

return $this->_productCollection;

And data showing correct.

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.