Skip to content

magento/magento2#40027: Product stock alert's website and stock misma…#40431

Merged
magento-devops-reposync-svc merged 7 commits intomagento:2.4-developfrom
KrasnoshchokBohdan:fix-for-issue-40027
Mar 5, 2026
Merged

magento/magento2#40027: Product stock alert's website and stock misma…#40431
magento-devops-reposync-svc merged 7 commits intomagento:2.4-developfrom
KrasnoshchokBohdan:fix-for-issue-40027

Conversation

@KrasnoshchokBohdan
Copy link
Copy Markdown
Contributor

Fix product alert website mismatch issue for multi-website setup

Description (*)

In multi-website setups, the admin product alerts grid displays incorrect website information. When a customer subscribes to product alerts on different websites, the grid shows the customer's registered website for all alerts instead of the actual subscription website.

This fix includes website_id and store_id from product_alert_stock and product_alert_price tables in the collection SELECT clause, ensuring the admin grid displays the correct website where each alert was subscribed.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Product stock alert's website and stock mismatch issue for multi website #40027

Manual testing scenarios (*)

  1. Configure multi-website setup with at least 2 websites
  2. Enable customer account sharing across websites (set customer/account_share/scope to 0)
  3. Create a customer account on Website A
  4. Subscribe to a stock alert for Product 1 on Website A
  5. Log in with the same customer on Website B
  6. Subscribe to a stock alert for Product 1 on Website B
  7. Go to Admin → Catalog → Products → Edit Product 1
  8. Click "Product Alerts" tab → verify alert shows Website A (not B)

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

… for multi website

Enhance product alert queries to include website_id and store_id
@m2-assistant
Copy link
Copy Markdown

m2-assistant Bot commented Jan 9, 2026

Hi @KrasnoshchokBohdan. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

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 Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@KrasnoshchokBohdan
Copy link
Copy Markdown
Contributor Author

@magento run all tests

@KrasnoshchokBohdan
Copy link
Copy Markdown
Contributor Author

@magento run Functional Tests B2B, Functional Tests EE

Copy link
Copy Markdown
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @KrasnoshchokBohdan,

Thank your for your contribution!

The changes looks good to us, but please cover the changes with some automated test in accordance to the DOD.

Thank you

@engcom-Hotel engcom-Hotel moved this from Review in Progress to Changes Requested in Community Dashboard Feb 3, 2026
@engcom-Charlie engcom-Charlie self-assigned this Feb 13, 2026
@engcom-Charlie
Copy link
Copy Markdown
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Copy Markdown
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Copy Markdown
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests,
Static Tests, Unit Tests

@engcom-Charlie
Copy link
Copy Markdown
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Copy Markdown
Contributor

@magento run Static Tests

@engcom-Charlie
Copy link
Copy Markdown
Contributor

Hello @KrasnoshchokBohdan,

Thank your for your contribution!

The changes looks good to us, but please cover the changes with some automated test in accordance to the DOD.

Thank you

@engcom-Hotel and @KrasnoshchokBohdan, I have implemented integration test to cover the changes. Requesting for the review.

@engcom-Hotel
Copy link
Copy Markdown
Contributor

@magento run all tests

Copy link
Copy Markdown
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failed tests seems flaky to me.

Approving the PR for further processing.

@engcom-Bravo
Copy link
Copy Markdown
Contributor

Hi @KrasnoshchokBohdan,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • Configure multi-website setup with at least 2 websites
  • Enable customer account sharing across websites (set customer/account_share/scope to 0)
  • Create a customer account on Website A
  • Subscribe to a stock alert for Product 1 on Website A
  • Log in with the same customer on Website B
  • Subscribe to a stock alert for Product 1 on Website B
  • Go to Admin → Catalog → Products → Edit Product 1
  • Click "Product Alerts" tab → verify alert shows Website A (not B)

Before: ✖️

Screenshot 2026-02-26 at 3 50 15 pm

After: ✔️

Screenshot 2026-02-26 at 3 54 36 pm

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks

@engcom-Bravo engcom-Bravo moved this from Testing in Progress to Extended testing (optional) in Community Dashboard Feb 26, 2026
@engcom-Charlie
Copy link
Copy Markdown
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests

@engcom-Charlie
Copy link
Copy Markdown
Contributor

Some of the Functional B2B, CE and EE failures are not consistent in recent 2 builds, they neither failing because of the PR changes nor part of the PR. Considered to be flaky. The rest consistent failures are known issues and having related JIRA. Hence moving this to Merge in Progress.

Functional B2B: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40431/5bf8590c25bf48855d94e67ee5f3d3e2/Functional/allure-report-b2b/index.html#categories

image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40431/6f03ebeb831a7dc8668acf9376f420fd/Functional/allure-report-b2b/index.html#categories/dad3b5a7b0574462665553fcc880a350/61cf4060ae70c62f/

image

Functional CE: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40431/e4bbbdc6e4228a6e63934f8b8e506744/Functional/allure-report-ce/index.html#categories

image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40431/20ab047784130e3a0875ad9d0bdbb79f/Functional/allure-report-ce/index.html#categories/dad3b5a7b0574462665553fcc880a350/5b7f39e360fef73b/

image

Functional EE: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40431/6dc75a4661a865402c2e01720133fd2d/Functional/allure-report-ee/index.html#categories

image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40431/a57d24baab7f833dd871362b1a443998/Functional/allure-report-ee/index.html#categories/dad3b5a7b0574462665553fcc880a350/68c3004a1cd380/

image

Known issues:
ACQE-9362: PurchaseOrderEnableDisableE2ETest
ACQE-9418: AdminDisplayingCartAndCatalogPriceRulesGridsTest
ACQE-9359: AssertSuccessMessageAppearsAfterAddingProductToCartThatContainsOutOfStockProductTest
ACQE-9450: AsyncOrderWithAsyncStockReservationTest

@engcom-Charlie engcom-Charlie moved this from Extended testing (optional) to Merge in Progress in Community Dashboard Feb 27, 2026
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit eaccc33 into magento:2.4-develop Mar 5, 2026
9 of 12 checks passed
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation Bot moved this from Merge in Progress to Recently Merged in Community Dashboard Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: deployment queue Project: Community Picked PRs upvoted by the community

Projects

Status: Recently Merged

Development

Successfully merging this pull request may close these issues.

Product stock alert's website and stock mismatch issue for multi website

5 participants