-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fixes #12584 Bundle Item price cannot differ per website #27315
Fixes #12584 Bundle Item price cannot differ per website #27315
Conversation
Hi @rain2o. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
@magento give me test instance |
Hi @rain2o. Thank you for your request. I'm working on Magento instance for you |
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.
Could you provide Integration Tests that will also clarify the overview of the change?
Introduction of Automated Tests is part of our Definition of Done:
https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing_dod.html
@lbajsarowicz I am a little unfamiliar with the Integration tests. I will attempt to do so. I don't see any integration tests in the Bundle module, but I see some in |
@rain2o Fix Static Tests then. |
@lbajsarowicz Sure thing, thanks for the assist. I noticed the static tests that are failing also fail on the |
Sorry, I see the Allure test results now and it's more clear to me. I just can't seem to successfully run these tests locally to get the same results. |
Hi @lbajsarowicz, thank you for the review.
|
@magento run all tests |
Hi @gabrieldagama, thank you for the review.
|
@magento run all tests |
Hi @rain2o, thank you for your contribution! |
Description
Bundle Item prices are missing their website id which is checked for in
\Magento\Bundle\Model\Selection::afterSave
. This check always failed.I started with the changes from PR #12586 and updated it to fix the issue of the website-scoped price overriding the global price.
Related Pull Requests
#12586
Fixed Issues
Manual testing scenarios
Expected result
The bundle item should have price '12' in the default scope and in the first store view
The bundle item should have price '10' in the second store view
Questions or comments
I tested this in multiple environments running Magento 2.4. Two out of three tested successfully. One of those environments throws an error when saving stock items (see below). Because this only happened in one environment I couldn't figure out if it was environmental or if there is another underlying issue related to this PR. It seems as though saving the Stock Item, even when updating an existing one, throws an error for a duplicate PRIMARY index. Which is strange as it is updating an existing entry.
Removing the following lines from
\Magento\Bundle\Model\LinkManagement
causes this error to go away, so it seems related to it. I just can't figure out how/why.Contribution checklist (*)