Skip to content

Commit

Permalink
Merge pull request #55 from Smile-SA/release_1.3
Browse files Browse the repository at this point in the history
Fix categories that were not indexed properly
  • Loading branch information
afoucret committed Mar 2, 2016
2 parents 138e073 + 76eb37b commit c133809
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,19 +365,21 @@ protected function _getAttributesById()
$attributes = Mage::getResourceModel($this->_attributeCollectionModel)
->setEntityTypeFilter($entityType->getEntityTypeId());

$conditions = array(
'additional_table.is_searchable = 1',
'additional_table.is_visible_in_advanced_search = 1',
'additional_table.is_filterable > 0',
'additional_table.is_filterable_in_search = 1',
'additional_table.used_for_sort_by = 1',
'additional_table.is_used_for_promo_rules',
$this->getConnection()->quoteInto('main_table.attribute_code = ?', 'status'),
$this->getConnection()->quoteInto('main_table.attribute_code = ?', 'visibility'),
);

$attributes->getSelect()->where(sprintf('(%s)', implode(' OR ', $conditions)));
if (method_exists($attributes, 'addToIndexFilter')) {
$conditions = array(
'additional_table.is_searchable = 1',
'additional_table.is_visible_in_advanced_search = 1',
'additional_table.is_filterable > 0',
'additional_table.is_filterable_in_search = 1',
'additional_table.used_for_sort_by = 1',
'additional_table.is_used_for_promo_rules',
$this->getConnection()->quoteInto('main_table.attribute_code = ?', 'status'),
$this->getConnection()->quoteInto('main_table.attribute_code = ?', 'visibility'),
);

$attributes->getSelect()->where(sprintf('(%s)', implode(' OR ', $conditions)));
}

$this->_attributesById = array();

foreach ($attributes as $attribute) {
Expand Down

0 comments on commit c133809

Please sign in to comment.