Skip to content

Refactor Product With Children to remove Double Conversion #1745

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

natedawg92
Copy link

Summary

$this->getSpecialPrice() and $this->getTierPrice() Return a converted price when using multiple currencies, however these prices there converted again a little bit further down the function

Example: Base Currency GBP, Product Price 1200, also shows prices in EUR with a conversion rate of 1.2 (simplified numbers for example)

$this->getSpecialPrice() will return the Product Final price but converted (1200 * 1.2 = 1440) and then this gets converted again on line 72 (1440 * 1.2 = 1728) giving us an incorrect amount.

I have refactored the currency conversion to convert just the final Price and Base Price so that if a special price / Tiered price returns a value then these are converted twice.

Result

prices are only converted when necessary so they are only converted once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant