Skip to content
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

Magento 2.4.5: Show Out Of Stock option outputs all available products during search #36055

Closed
1 of 5 tasks
pmonosolo opened this issue Aug 30, 2022 · 27 comments · Fixed by #35986
Closed
1 of 5 tasks
Assignees
Labels
Area: Catalog Component: SampleData Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@pmonosolo
Copy link

pmonosolo commented Aug 30, 2022

Preconditions and environment

  • Magento version 2.4.5
  • PHP 8.1
  • ES 7.17.0

On website I'm working on to upgrade to 2.4.5 from 2.4.3, the Catalog Search ouputs the whole Enabled Catalog:

image

Instead of only ouputting the search results which should be 664 items:

image

Sorry bad screenshots because I was pulling the store apart to try to understand where it's coming from.

This can sort of be replicated on Vanilla Magento 2.4.5 with test data.

Here are the settings:

Catalog - > Inventory
This is the main culprit (Display Out Of Stock Products = YES)
image

I believe there are some settings in the Catalog section that are also affecting the issue:

Catalog - > Catalog
image
image
image
image
image
image
image
image

Steps to reproduce

  1. Login as admin.
  2. Go to Stores >> configuration >> Catalog >> Inventory >> Display Out Of Stock Products = YES)
  3. On Vanilla 2.4.5 storefront Search for "ryker" it should output two items

/catalogsearch/result/?q=ryker

Expected result

Two items are shown:
image

Actual result

But it shows two items and toolbar shows "181 items":
image

Additional information

On my site this is creating a problem because each search instead of 2 seconds, becomes a 22 second search. HELP!

Release note

No response

Triage and priority

  • 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”.
@m2-assistant
Copy link

m2-assistant bot commented Aug 30, 2022

Hi @pmonosolo. 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.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 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.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@pmonosolo
Copy link
Author

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @pmonosolo. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@pmonosolo
Copy link
Author

@pmonosolo
Copy link
Author

@magento give me 2.4.3 instance

@magento-deployment-service
Copy link

Hi @pmonosolo. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@pmonosolo
Copy link
Author

@pmonosolo
Copy link
Author

It looks like the fix for this issue is in this thread:
magento/inventory#3360

I need to test a bit more, but so far, it's outputting only the items in the search.

@Bashev
Copy link
Contributor

Bashev commented Aug 30, 2022

Probably fixed in #35986

@pmonosolo
Copy link
Author

pmonosolo commented Aug 30, 2022

@Bashev

Probably fixed in #35986

Hmmm, doesnt seem to work. The page loading time is still slow.

The fix in vendor\magento\module-inventory-catalog\Plugin\Catalog\Block\ProductList\UpdateToolbarCount.php

image

It looks like somebody by mistake is calling wrong method - it pulls the WHOLE product collection rather than a collection related to the search.

image

I need to test other parts of the catalog page in case there's some hidden issue thats not related to search.

Although, it should not be really working.

The whole piece of code is being skipped:

image

So this fix migth work for single store with one view, but for others not so much.

@Amadeco
Copy link

Amadeco commented Aug 31, 2022

The both solutions for me doesn't work :

I am on Magento 2.4.5 and PHP 8.1.
My guess, if it is working for you, a 3rd party extension (I am using Smile Elasticsuite) but I cannot see any plugins which modify this part of the code.
I am not using single-store mode.

@pmonosolo
Copy link
Author

The both solutions for me doesn't work :

I am on Magento 2.4.5 and PHP 8.1. My guess, if it is working for you, a 3rd party extension (I am using Smile Elasticsuite) but I cannot see any plugins which modify this part of the code. I am not using single-store mode.

Search for their name in the issues, I believe I've seen somebody working on this issue for that specific plugin.

@Amadeco
Copy link

Amadeco commented Sep 1, 2022

Thank you @pmonosolo for your heads up.

Indeed, I found Smile-SA/elasticsuite#2663 (comment) but it is the same solution as magento/inventory#3360.

@pmonosolo
Copy link
Author

Ah, I just disabled that Plugin.

image

They need to rewrite that to check for:

  • If page is Catalog Search Page
  • If there are filters applied.

Currently it just checks the Category page, so on Search Page it uses "Default Category" and outputs the whole catalog.

When you filter by attributes, it does not decrease the number because the only lookup that is done is for Category. It does not check if filters were applied to the category.

@engcom-Lima engcom-Lima self-assigned this Sep 29, 2022
@m2-assistant
Copy link

m2-assistant bot commented Sep 29, 2022

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: 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 branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced 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.

@engcom-Lima
Copy link
Contributor

@magento give me 2.4.5 instance

@magento-deployment-service
Copy link

Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Lima
Copy link
Contributor

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @engcom-Lima. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@engcom-Lima
Copy link
Contributor

✔️ Issue confirmed

Issue got reproduced in Magento 2.4-develop and 2.4.5

Description:
Showing wrong count of items for Ryker product when Display out of stock options is set to Yes.

Pre-requisite:
Fresh magento 2.4-develop && 2.4.5 should be installed.

Steps to reproduce:

  1. Login as admin.
  2. Go to Stores >> configuration >> Catalog >> Inventory >> Display Out Of Stock Products = YES)
  3. On Vanilla 2.4.5 storefront Search for "ryker" it should output two items.

Expected result: It should show 2 items for ryker product.

Actual result: It is showing 187 items as shown in screenshot below:

Screenshots:
Screenshot 2022-09-29 at 3 05 05 PM

@engcom-Lima engcom-Lima added Component: SampleData Area: Catalog Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Reported on 2.4.5 Indicates original Magento version for the Issue report. Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Sep 29, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-6768 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Sep 29, 2022

✅ 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.

@sdzhepa sdzhepa added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Sep 29, 2022
@pmonosolo
Copy link
Author

pmonosolo commented Sep 29, 2022

Thanks @engcom-Lima !

The issue is not really in the number, its the time it takes to pull the number of the products.

If you have a 300,000 sku store, this is an issue because it outputs the whole catalog 300,000 products on a search page, for EVERY search!

This is why I think there should be two sample data types - one for small store (1000), one for big store (300,000 skus). Some difficult to detect issues are more visible on big stores only.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Catalog Component: SampleData Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.5 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Archived in project
6 participants