Fix/33253 fix order number in notice #33802
Merged
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.
All Submissions:
Changes proposed in this Pull Request:
This PR fixes the incorrect count of order numbers displayed in the 'Order status changed' and 'Removed personal data' notices after bulk editing a large number of orders ( > 999 ).
The problem lies in this line of code :
sprintf( _n( '%s order status changed.', '%d order statuses changed.', $number, 'woocommerce' ), number_format_i18n( $number ) )
So, if $number is 1000,
number_format_i18n()
converts it into string '1,000' whichsprintf()
renders as '1' due to the specifier%d
, which treats the resultant string ('1,000') as an integer and renders it as a (signed) decimal number.I have replaced the
%d
with%s
for both 'Order status changed' and 'Removed personal data' notices.With this fix, the order count will reflect correctly in the notice :
Closes #33253
How to test the changes in this Pull Request:
/wp-admin/edit.php?post_type=shop_order&paged=1&bulk_action=marked_completed&changed=9999
OR
Other information:
pnpm changelog add --filter=<project>
?FOR PR REVIEWER ONLY: