-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Issue 36096: Layered Navigation does not filter products properly #36102
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
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @rogerdz. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
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.
Hi @rogerdz ,
Thank you for your contribution. Please check my comment.
And as the Magento Definition of Done, this change should be convered by Automation test. I think the Unit/Integration test can be covered that. Could you please add it to this PR ?
* @return array | ||
* @since 100.1.0 | ||
*/ | ||
protected function _getCatalogProductInventoryData($productIds = null) |
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.
Should be private function
_getCatalogProductInventoryData
change to getCatalogProductInventoryData
as Magento standard code.
* @param array $skippedFields | ||
* @param array $map | ||
*/ | ||
public function __construct( | ||
AttributeProvider $attributeAdapterProvider, | ||
FieldNameResolver $fieldNameResolver, | ||
ScopeConfigInterface $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.
ScopeConfigInterface $scopeConfig
should be moved to the end of the contruct because of Backward compatible.
ScopeConfigInterface $scopeConfig = null
and:
$this->scopeConfig = $scopeConfig ?: ObjectManager::getInstance()->get(ScopeConfigInterface::class);
* | ||
* @return array | ||
*/ | ||
public function getSortBySaleability() |
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.
introduce the public function. @sidolov Can you give us some advice about that ?
$fieldName = $this->fieldNameResolver->getFieldName($attribute); | ||
$sorts[] = [ | ||
$fieldName => [ | ||
'order' => 'desc' |
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.
desc
should be changed to constant in the Magento framework
$sorts = []; | ||
|
||
if ($this->hasShowOutOfStockStatus()) { | ||
$attribute = $this->attributeAdapterProvider->getByAttributeCode('is_salable'); |
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.
Should declare the constant for the is_salable
* @param int $websiteId | ||
* @return array | ||
*/ | ||
public function getInventoryIndexData($productIds, $websiteId = null) |
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.
introduce the public function make the Semantic test failed. @sidolov Can you give us some advice about that ?
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.
Backward capability don't allow introduce new public methods to class marked as @api
and should be replaced by new class
Hello, I have de same problem (Adobe Commerce ver. 2.4.5). I applied the patch proposed by @edenduong , but the problem still persists Do you have a solution to fix this problem? |
Description (*)
Layered Navigation does not filter products properly
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)