This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Check for bundle selection scoped price per website #239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an anticipatory fix to account for a Magento 2 bug fix that is currently being reviewed. See magento/magento2#27315.
The original issue with Magento was that when you set the configuration of Price Scope to be "WEBSITE", the bundle option item prices are not saved properly per website. Once the linked PR is approved and merged, this PR will account for the scoped prices when indexing the bundle products.
As a note, this modification shouldn't make any difference before the Magento bug is fixed, as it performs a check to see if there are any scoped prices and falls back to the global price if not. With that said, if you want to test and merge this before the Magento PR, it should mean this module will be compatible with the update if/when it goes through.
For reference, I took the code from
source/vendor/magento/module-bundle/Model/ResourceModel/Selection/Collection.php::joinPrices()
to use the same logic Magento core uses when pulling Bundle products with prices.