-
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
Solve fatal error on credit memo mail #25618
Solve fatal error on credit memo mail #25618
Conversation
Hi @arnoudhgz. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Also insert the correct item for invoice mail, to calculate the appropriate subtotal on row item.
84b9352
to
5ceb842
Compare
@joni-jones the CLA is in progress by someone from my company. Can you advice me on the |
@sidolov / @joni-jones can you advice me on the Semantic Version checker? All other checks are passed. |
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.
Hi @arnoudhgz,
I just looked on your fix - for sure it should work, however it looks like class app/code/Magento/Sales/Block/Order/Email/Items/Order/DefaultOrder.php
is designed for rendering order items, so this issue is wider - looks like incorrect block is used for rendering invoice and credit memo items.
Could you investigate why it tries to use this block for rendering credit memo and invoice items and adjust your solution?
Hi @arnoudhgz, |
@ihor-sviziev at the moment I do not have the time to investigate the wider issue about the wrong class usage. I don't know if it is actually wrong since the items are rendered from the related order... But the related ticket is closed, so maybe it is already differently solved in the code? |
Hi @arnoudhgz, Thank you for your contribution! |
Hi @arnoudhgz, thank you for your contribution! |
Also insert the correct item for invoice mail, to calculate the appropriate subtotal on row item.
This is an addition of PR #22265 where the subtotal for creditmemo should be fixed. Now this same strategy is chosen for the invoice mail and the fatal error caused by this previous PR is solved.
By checking the type instance of
$item
I tried to keep it as strict as possible while keeping code the change as simple as possible.Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)