magento2
magento2 copied to clipboard
Catalog shown entire catalog items count if show_of_stock_option enabled
Preconditions and environment
- 2.4-develop Vanila instance
Steps to reproduce
- Take Vanila instance by magento give me 2.4-develoop instance
- Go to Stores->Configuration->Catalog->Inventory and Enable Display Out of Stock Products
- Clear cache
- Go to catalog Women->Tops->Bras & Tanks
- Apply Filter Style->Bra that show 5 items
Expected result
Total catalog items should show 5 items and 5 as total value
Actual result
- Shown 12 items in catalog
- Shown 14 as total items
Additional information
No response
Release note
No response
Triage and priority
- [X] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @Den4ik. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
- Summary of the issue
- Information on your environment
- Steps to reproduce
- Expected and actual results
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues 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.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
-
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears. -
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Description
label to the issue by yourself. -
[ ] 3. Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! -
[ ] 5. Add label
Issue: Confirmed
once verification is complete. -
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @engcom-Lima. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
-
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is valid
appears. -
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Description
label to the issue by yourself. -
[ ] 3. Add
Component: XXXXX
label(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-develop
branchDetails
- Add the comment@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-develop
branch, please, add the labelReproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! -
[ ] 5. Add label
Issue: Confirmed
once verification is complete. -
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
@magento give me 2.4-develop instance
Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Lima, here is your Magento Instance: https://a9e471e7ff78aa58a1710cfd84b5b22f.instances.magento-community.engineering Admin access: https://a9e471e7ff78aa58a1710cfd84b5b22f.instances.magento-community.engineering/admin_f688 Login: d9987951 Password: 4221d87bd27d
:heavy_check_mark: Issue confirmed
Issue got reproduced in 2.4-develop branch.
Description: Showing wrong inventory count in the frontend. Pre-requisite: 2.4-develop Vanila instance
Steps to reproduce:
- Take Vanila instance by
@magento give me 2.4-develoop instance
. - Go to Stores->Configuration->Catalog->Inventory and Enable Display Out of Stock Products
- Clear cache
- Go to catalog Women->Tops->Bras & Tanks
- Apply Filter Style->Bra that show 5 items
Expected result: Total catalog items should show 5 items and 5 as total value
Actual result : It was showing 14 items.
Screenshot:
Hence,confirming the issue.
Thanks
Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Lima, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6395 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Lima. Thank you for verifying the issue.
Issue Available: @engcom-Lima, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
This commit broke this functionality and need to be refactored: https://github.com/magento/magento2/commit/3a889f465e21cdba4a78788704f3c5b31f3d2d9f Reverting everything back does help. I'm not absolutely sure about the logic stored in that private method.
@magento give me 2.4-develoop instance
Hi @Bashev. Thank you for your request. I'm working on Magento instance for you.
Hi @Bashev, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.
@Den4ik can you make a review for this fix?
Also check the magento inventory repo more often please there i reported the same issue: https://github.com/magento/inventory/issues/3360
It looks like no one is active on that repo to pick the issues up.
These are probably related: https://github.com/magento/magento2/issues/36055
I did a bit of testing between 2.4.5 and 2.4.3 and 2.4.3 works correctly.
2.4.5 outputs the whole catalog - it makes a search page output ALL enabled products which results in a 22 second page loading time.
Whoever is working on this, please release this as a hotfix - this is an important part of the store. PHP 7.4 is EOL in 2 months, we've gotta get it fixed.
Ya'll should try the fix in this thread: https://github.com/magento/inventory/issues/3360
@pmonosolo see also my fix https://github.com/magento/magento2/pull/35986
@Den4ik Thanks for contributing, internal team has started working on this.
Any updates on this matter?
@i6media It will be merge soon, PR in queue
@glo71317 could you link the correct PR here? The one from @Bashev is not sufficient since it still fetches all products and filters them afterwards by PHP (slow loading times), instead of in the query itself.
@i6media We raised the internal PR so you will not have the access for the same, so i don't think it will help. we have taken the commits from @Bashev PR and written automation tests.
@glo71317 can you provide a patch file for the changes?
Hello,
As I can see this issue got fixed in the scope of the internal Jira ticket AC-6395 by the internal team Related commits: https://github.com/magento/magento2/search?q=AC-6395&type=commits
Based on the Jira ticket, the target version is 2.4.6.
Thanks
@ssx you can copy the file (https://github.com/magento/magento2/blob/7792c18603d80f020dd0265d78ecf0ad8f64f944/app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php) and temporarily overwrite it in your own module through di.xml, until the new versions comes out.
<preference for="Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplier" type="Foo\Bar\Plugin\Magento\Elasticsearch\Model\ResourceModel\Fulltext\Collection\SearchResultApplier" />