Skip to content
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

Conversation

arnoudhgz
Copy link
Contributor

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)

  1. Fatal error on creditmemo mail grouped product #25617: Fatal error on creditmemo mail grouped product

Manual testing scenarios (*)

  1. Add grouped product to cart, make sure to have for one item 3 products.
  2. Place order.
  3. In the backend create invoice for this order, nb make sure to invoice only 2 of the 3 products (update qty)
  4. Send invoice mail, see that the subtotal is correct
  5. In the backend create credit memo for this same order, nb make sure to only credit 1 product (update qty)
  6. Send credit memo mail, see that the subtotal is correct.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Nov 15, 2019

Hi @arnoudhgz. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Area: Frontend Component: Sales Release Line: 2.3 Partner: MediaCT Pull Request is created by partner MediaCT partners-contribution Pull Request is created by Magento Partner labels Nov 15, 2019
Also insert the correct item for invoice mail, to calculate the
appropriate subtotal on row item.
@arnoudhgz arnoudhgz force-pushed the feature/25617-solve-fatal-error-creditmemo-mail branch from 84b9352 to 5ceb842 Compare November 15, 2019 14:05
@arnoudhgz
Copy link
Contributor Author

@joni-jones the CLA is in progress by someone from my company. Can you advice me on the Semantic Version Checker failure?

@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:12
@arnoudhgz
Copy link
Contributor Author

arnoudhgz commented Dec 11, 2019

@sidolov / @joni-jones can you advice me on the Semantic Version checker? All other checks are passed.

@ihor-sviziev ihor-sviziev self-assigned this Mar 3, 2020
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a 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?

@ihor-sviziev
Copy link
Contributor

Hi @arnoudhgz,
Will you be able to update your PR?

@arnoudhgz
Copy link
Contributor Author

arnoudhgz commented Mar 19, 2020

@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?

@ihor-sviziev
Copy link
Contributor

Hi @arnoudhgz,
Yeah, I see that related issue was already closed.
So I'm closing this PR as issue isn't reproducing anymore.

Thank you for your contribution!

@m2-assistant
Copy link

m2-assistant bot commented Mar 20, 2020

Hi @arnoudhgz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Component: Sales Partner: MediaCT Pull Request is created by partner MediaCT partners-contribution Pull Request is created by Magento Partner Progress: needs update Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants