-
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
Error While send Invoice with Grouped Products #5105
Comments
Hi @srbarba , we cannot reproduce this scenario on current develop(3561b66). |
Hello! Steps:
Result: See that video! I tryed without "Autosettings" changes(at simple product) too, nothing change. |
Hi @srbarba , thank you for your video. |
Hi, Just to let you know I'm also getting this similar when you try and click on "send email" for an invoiced order. I'm also using magento version 2.0.7 Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder::getItemPrice() must be an instance of Magento\Sales\Model\Order\Item, instance of Magento\Sales\Model\Order\Invoice\Item given, called in /Users/chris/Sites/magento_test/vendor/magento/module-sales/view/frontend/templates/email/items/invoice/default.phtml on line 34 and defined in /Users/chris/Sites/magento_test/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php:97 Stack trace: #0 /Users/chris/Sites/magento_test/vendor/magento/module-sales/view/frontend/templates/email/items/invoice/default.phtml(34): Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder->getItemPrice(Object(Magento\Sales\Model\Order\Invoice\Item)) #1 /Users/chris/Sites/magento_test/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/Users/chris...') #2 /Users/chris/Sites/magento_test/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\Vi in /Users/chris/Sites/magento_test/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php on line 97 Thanks |
Hi, Btw - The problem is the Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder::getItemPrice() method.
If you take off the Type hint OrderItem $item for the argument and just have:
it works fine |
Also this is in magento 2.1.12 as well |
Hi everyone. Any news about this error? Cheers. |
Experiencing the issue on 2.1.4. |
It is tricky to implement a workaround as a custom module, because the signature of the method Looking forward to the fix in core. |
@Mulderua please provide an update about this issue? It's almost been a year since this issue was posted.. |
just create preference for and extend your block from |
Same error 2.1.5
Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder::getItemPrice() must be an instance of Magento\Sales\Model\Order\Item, instance of Magento\Sales\Model\Order\Invoice\Item given, called in /var/www/html/vendor/magento/module-sales/view/frontend/templates/email/items/invoice/default.phtml on line 34 and defined in /var/www/html/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php:97 Stack trace: #0 /var/www/html/vendor/magento/module-sales/view/frontend/templates/email/items/invoice/default.phtml(34): Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder->getItemPrice(Object(Magento\Sales\Model\Order\Invoice\Item)) #1 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/v...') #2 /var/www/html/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped), '/var/www/html/v...', Array) # in /var/www/html/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php on line 97 |
@srbarba, thank you for your report. |
Hi @srbarba the issue has been fixed in 2.2-develop branch and will be available in 2.2.1 release soon |
Internal ticket to track issue progress: MAGETWO-81340 |
This is still an error in Magento 2.2.1 |
The fix was delivered in 2.2.2 60d6628 |
Hi @srbarba. Thank you for your report. The fix will be available with the upcoming patch release. |
The error appears again, and it seemed like that the change to fix the issue has been reverted in 62fed32 |
Hi @engcom-Echo. Thank you for working on this issue.
|
Hello @arnoudhgz Thank you for your report and collaboration! Testing scenario: Preconditions: Steps to reproduce:
Result: |
@engcom-Echo you are correct, the issue I found was about the credit memos (the file is almost similar). I will try it out again for credit memos and create a new issue. |
Steps to reproduce
develop
branch.Expected result
Actual result
The error from report:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\\Sales\\Block\\Order\\Email\\Items\\Order\\DefaultOrder::getItemPrice() must be an instance of Magento\\Sales\\Model\\Order\\Item, instance of Magento\\Sales\\Model\\Order\\Invoice\\Item given, called in /var/www/vhosts/superpiensos.com/development/vendor/magento/module-sales/view/frontend/templates/email/items/invoice/default.phtml on line 34 and defined in /var/www/vhosts/superpiensos.com/development/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php:97\nStack trace:\n#0 /var/www/vhosts/superpiensos.com/development/vendor/magento/module-sales/view/frontend/templates/email/items/invoice/default.phtml(34): Magento\\Sales\\Block\\Order\\Email\\Items\\Order\\DefaultOrder->getItemPrice(Object(Magento\\Sales\\Model\\Order\\Invoice\\Item))\n#1 /var/www/vhosts/superpiensos.com/development/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/vhosts...')\n#2 /var/www/vhosts/superpiensos.com/development/vendor/magento/fr...\n', referer: http://magento.superpiensos.com/admin_superp/sales/order_invoice/new/order_id/92/key/a6d27d6abf43f83c88d6e6be59095107f13ef4b74420fb3697e35953217a52ac/
The text was updated successfully, but these errors were encountered: