Skip to content

Commit

Permalink
Merge pull request #56 from Smile-SA/release_1.3
Browse files Browse the repository at this point in the history
Virtual categories, prevent processing empty values if no product ids
  • Loading branch information
romainruaud committed Mar 2, 2016
2 parents c133809 + 5a493d0 commit b2a2f0a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function _getVirtualRule($category)
*
* @event catalogsearch_query_save_after
*
* @return void Nothing
* @return Smile_VirtualCategories_Model_Observer
*/
public function saveProductsPositions(Varien_Event_Observer $observer)
{
Expand All @@ -132,6 +132,10 @@ public function saveProductsPositions(Varien_Event_Observer $observer)

$productIdsToReindex = array_unique(array_merge($previousProducts, array_keys($filteredPositions)));

if (empty($productIdsToReindex)) {
return $this;
}

// If Enterprise version, Mview index will handle editing, otherwise, process reindex
if (!Mage::helper("smile_elasticsearch")->isEnterpriseSupportEnabled()) {

Expand All @@ -156,6 +160,7 @@ public function saveProductsPositions(Varien_Event_Observer $observer)

}
}
return $this;
}

/**
Expand Down

0 comments on commit b2a2f0a

Please sign in to comment.