-
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 #21725 - Render price on category list with correct precision for current locale #21829
Fix #21725 - Render price on category list with correct precision for current locale #21829
Conversation
Hi @Bartlomiejsz. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @aleron75, thank you for the review. |
Hello @Bartlomiejsz thanks for your contribution. Once merged, don't forget you can easily port this PR (if needed) to other branches with the Porting Tool, read more here. |
Hi @Bartlomiejsz during testing, I found more places when price is rendered with incorrect precision. And subtotal price on cart page is rendered with two comma separators(issue is present on 2.3-develop and not caused by PR). So price inconsistency is still present after your fix. Manual testing scenario:
@sivaschenko Could you check if testing scenario is valid for PR changes? |
@magento-engcom-team give me test instance |
Hi @sivaschenko. Thank you for your request. I'm working on Magento instance for you |
Hi @sivaschenko, here is your new Magento instance. |
@VasylShvorak the scenario looks valid to me. I think the sum is displayed correctly during checkout (looks like two different commas used) @Bartlomiejsz would you be able to fix the price precision in the mini cart, shopping cart page and emails for consistency? |
@sivaschenko yes, I will work on that |
@VasylShvorak @sivaschenko could you test this one again with newest changes? |
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.
Thanks for updates @Bartlomiejsz A couple of minor changes required for backward compatibility: please see my review comments
@magento run all tests |
* @since 102.0.6 | ||
*/ | ||
public function getFormattedTierPrice($qty, $product) | ||
{ | ||
$price = $product->getTierPrice($qty); | ||
if (is_array($price)) { | ||
foreach (array_keys($price) as $index) { | ||
$price[$index]['formatted_price'] = $this->priceCurrency->convertAndFormat( | ||
$price[$index]['formatted_price'] = $this->amount->convertAndFormatCurrency( | ||
$price[$index]['website_price'] | ||
); | ||
} | ||
} else { |
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.
As done before to improve readability, the return early pattern can also be applied here, returning $price
at the end of the loop and avoiding the else
statement.
Moving to on hold as this PR waiting for opening 2.5 develop branch |
@Bartlomiejsz Branch 2.5-develop was already created. Could you re-target this PR to the 2.5-develop branch? |
Yes, @ihor-sviziev I'll try to work on this PR in upcoming days |
5f1858e
to
1e846a4
Compare
Hi @Bartlomiejsz, thank you for your contribution! |
@sivaschenko didn't really try to close this PR, it got automatically closed when I force pushed changes re-created on 2.5-develop branch, I will create new one for it |
@Bartlomiejsz seems like you force pushed branch with no changes |
Description (*)
This PR changes price rendering on category view to include correct precision for current locale and currency.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)