Skip to content

Commit 57dd684

Browse files
committed
MAGETWO-64459: [Backport] - Can't get store-specific data via catalog API - for 2.1
1 parent ab10a3e commit 57dd684

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -676,18 +676,15 @@ protected function addFilterGroupToCollection(
676676
*/
677677
private function applyCustomFilter(Collection $collection, \Magento\Framework\Api\Filter $filter, $conditionType)
678678
{
679-
$isApplied = false;
680-
$categoryFilter = [];
681-
682679
if ($filter->getField() == 'category_id') {
683680
$categoryFilter[$conditionType][] = $filter->getValue();
684681
$collection->addCategoriesFilter($categoryFilter);
685-
$isApplied = true;
682+
return true;
686683
}
687684

688685
if ($filter->getField() == 'store') {
689686
$collection->addStoreFilter($filter->getValue());
690-
$isApplied = true;
687+
return true;
691688
}
692689

693690
if ($filter->getField() == 'website_id') {
@@ -696,10 +693,10 @@ private function applyCustomFilter(Collection $collection, \Magento\Framework\Ap
696693
$value = explode(',', $value);
697694
}
698695
$collection->addWebsiteFilter($value);
699-
$isApplied = true;
696+
return true;
700697
}
701698

702-
return $isApplied;
699+
return false;
703700
}
704701

705702
/**

app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,10 +1374,10 @@ public function expectAddToFilter($fieldName, $collectionMock)
13741374
public function fieldName()
13751375
{
13761376
return [
1377-
// ['category_id'],
1378-
// ['store'],
1377+
['category_id'],
1378+
['store'],
13791379
['website_id'],
1380-
// ['field'],
1380+
['field'],
13811381
];
13821382
}
13831383
}

0 commit comments

Comments
 (0)