Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8080 from mage2pratik/patch-60
Browse files Browse the repository at this point in the history
Moved the else logic before if condition
  • Loading branch information
dobooth authored Oct 19, 2020
2 parents c7d154d + 8950509 commit 1a9890d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,11 @@ class ProductCategoryFilter implements CustomFilterInterface
{
$value = $filter->getValue();
$conditionType = $filter->getConditionType() ?: 'in';
$filterValue = [$value];
if (($conditionType === 'in' || $conditionType === 'nin') && is_string($value)) {
$value = explode(',', $value);
} else {
$value = [$value];
$filterValue = explode(',', $value);
}
$categoryFilter = [$conditionType => $value];
$categoryFilter = [$conditionType => $filterValue];

/** @var Collection $collection */
$collection->addCategoriesFilter($categoryFilter);
Expand Down

0 comments on commit 1a9890d

Please sign in to comment.