-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5325 Modified criteria builder to include visibility filter #144
5325 Modified criteria builder to include visibility filter #144
Conversation
/** | ||
* @var ScopeConfigInterface | ||
*/ | ||
private $scopeConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make all properties as protected. Otherwise on extending class it will be required to define properties again.
* @param bool $isSearch | ||
* @param bool $isFilter | ||
*/ | ||
private function addVisibilityFilter(SearchCriteriaInterface $searchCriteria, bool $isSearch): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make protected, same case
); | ||
if ($priceRangeCalculation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before block
$defaultSortOrder = []; | ||
if ($isSearch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
$categoryIdFilter = isset($args['filter']['category_id']) ? $args['filter']['category_id'] : false; | ||
if ($categoryIdFilter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
$filterGroups = $searchCriteria->getFilterGroups(); | ||
foreach ($filterGroups as $filterGroup) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here and so on
} | ||
$searchCriteria->setRequestName($requestName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after block if scope is not closed after it.
@@ -0,0 +1,250 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please comment in code on which lines are actually changed from original class.
Fixes 5325.
Issue:
If product visibility is set to Catalog only, it is still displayed in search results.
In this PR:
Modified search criteria builder to add visibility filters to search queries.