Skip to content

Commit 232ba1a

Browse files
author
Fabian Schmengler /
authored
Merge pull request #16 from tim-bezhashvyly/patch-1
Issue #15: Fallback to Magneto if category is excluded from Solr index
2 parents 7773777 + b84e34d commit 232ba1a

File tree

1 file changed

+11
-7
lines changed
  • src/app/code/community/IntegerNet/Solr/Model/Catalog

1 file changed

+11
-7
lines changed

src/app/code/community/IntegerNet/Solr/Model/Catalog/Layer.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ public function getProductCollection()
2020
return parent::getProductCollection();
2121
}
2222

23-
if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
24-
$collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
25-
} else {
26-
$collection = Mage::getModel('integernet_solr/result_collection');
27-
$this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
23+
$category = $this->getCurrentCategory();
24+
25+
if ($category->getData('solr_exclude')) {
26+
return parent::getProductCollection();
2827
}
29-
return $collection;
28+
29+
if (! isset($this->_productCollections[$category->getId()])) {
30+
$this->_productCollections[$category->getId()] = Mage::getModel('integernet_solr/result_collection');
31+
}
32+
33+
return $this->_productCollections[$category->getId()];
3034
}
3135

3236
/**
@@ -52,4 +56,4 @@ public function getFilterableAttributes()
5256
return $collection;
5357
}
5458

55-
}
59+
}

0 commit comments

Comments
 (0)