From d1132a3ac9382cfdda8f53b7e3f033f9da5cfe1b Mon Sep 17 00:00:00 2001 From: Andreas von Studnitz Date: Wed, 27 Jun 2018 15:09:33 +0200 Subject: [PATCH] Add status filter to product collection on check for 100% matches of attributes --- src/app/code/community/IntegerNet/Solr/Model/Observer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/code/community/IntegerNet/Solr/Model/Observer.php b/src/app/code/community/IntegerNet/Solr/Model/Observer.php index 3fcb1f9..8d9207b 100644 --- a/src/app/code/community/IntegerNet/Solr/Model/Observer.php +++ b/src/app/code/community/IntegerNet/Solr/Model/Observer.php @@ -212,6 +212,7 @@ protected function _getProductPageRedirectUrl($query) $matchingProductCollection ->addStoreFilter() ->addWebsiteFilter() + ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED) ->addAttributeToFilter($filters) ->addAttributeToSelect(array('status', 'visibility', 'url_key')) ->setOrder('visibility', 'desc'); @@ -298,6 +299,7 @@ protected function _getProductUrl($product) $parentProductCollection ->addStoreFilter() ->addWebsiteFilter() + ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED) ->addIdFilter($parentProductIds) ->addAttributeToSelect(array('status', 'visibility', 'url_key'));