-
Notifications
You must be signed in to change notification settings - Fork 49
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: handle zero cover fee percentage #3452
Conversation
// Just one decimal place, please. | ||
$flat_percentage = (float) number_format( ( ( $total - $subtotal ) * 100 ) / $subtotal, 1 ); | ||
$flat_percentage = 0; | ||
if ( $subtotal > 0 ) { |
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.
very NIT: but since we're here, why not also check if this is actually a number?
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.
Sure thing! Done in 846bdc2
## [5.3.12](v5.3.11...v5.3.12) (2024-10-01) ### Bug Fixes * handle zero cover fee percentage ([#3452](#3452)) ([742b378](742b378))
🎉 This PR is included in version 5.3.12 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 5.4.0-alpha.8 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Closes https://app.asana.com/0/1200550061930446/1208449408463805/f
Addresses an issue where the logic for rendering cover fee percentage text causes a fatal when switching subscriptions via My Account.
How to test the changes in this Pull Request:
release
you will get a fatal. On this branch you will not.Bonus: Go through the normal checkout flow for a donation with cover fees to confirm nothing has broken.
Other information: