-
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
Fix #7371 #8593
Merged
Merged
Fix #7371 #8593
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
#8593 (comment)
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.
@orlangur Sorry, I can't understand what I should see in diff. Problem is 'catalog_rule_price' which is added to join in Magento\CatalogRuleConfigurable\Plugin\ConfigurableProduct\Model\ResourceModel\AddCatalogRulePrice. I didn't see any mention about current currency (if value from db already in current currency we should see something about it) or conversion of the value in this file, and I didn't see any places where 'catalog_rule_price' or 'rule_price' converts to current currency after. Maybe I miss something?
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.
Where this value is stored? I believe currency conversion is missed there.
So, it's better to store totally prepared value than convert it after.
However, if the value stored in product is not store-aware by design, fix looks ok to me. To avoid regression it's better to create proper integration test, with catalog rule and multiple currencies, as change of started to fail unit test does not enforce anything (i.e. somebody doing next changes will just do the same - change hardcoded expectations - as test case is not sticked to any concrete scenario).
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.
This value is stored in the 'catalogrule_product_price' table. As I know all prices in Magento is converted after (from base currency to selected on site) and it's too much work to store prepared value because there is should be added a new dimension by currency per store. Value which is stored in product is website-aware, but currency is another dimension (you can have many currencies for one store view).
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.
I see... Thanks, that's exactly what I was asking.
Then
Integration test would be really valuable to not ever break this place again, but it's up to you, of course, whether invest time in it or not.