Skip to content

Commit

Permalink
Merge pull request #661 from afoucret/fix-attribute-autocomplete-error
Browse files Browse the repository at this point in the history
Fix #660 : fatal error in attribute autocomplete.
  • Loading branch information
afoucret authored Dec 18, 2017
2 parents 8062b32 + 761ae24 commit 66d9e26
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ public function getItems()
$filterField = $this->attributeConfig->getFilterField($attribute);
$facetData = $this->productCollection->getFacetedData($filterField);

foreach ($facetData as $currentFilter) {
if ($currentFilter['value'] != '__other_docs') {
$currentFilter['attribute_code'] = $attribute->getAttributeCode();
$currentFilter['attribute_label'] = $attribute->getStoreLabel();
$currentFilter['type'] = $this->getType();
$items[] = $this->itemFactory->create($currentFilter);
foreach ($facetData as $filterValue => $currentFilter) {
if ($filterValue != '__other_docs') {
$itemData = [
'value' => $filterValue,
'attribute_code' => $attribute->getAttributeCode(),
'attribute_label' => $attribute->getStoreLabel(),
'type' => $this->getType(),
'count' => $currentFilter['count'],

];
$items[] = $this->itemFactory->create($itemData);
}
}
}
Expand Down

0 comments on commit 66d9e26

Please sign in to comment.