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

New Order email test error with Giftcard product #5

Open
apomili opened this issue Nov 8, 2022 · 4 comments
Open

New Order email test error with Giftcard product #5

apomili opened this issue Nov 8, 2022 · 4 comments

Comments

@apomili
Copy link

apomili commented Nov 8, 2022

Hi guys, thankyou for this fantastic module.

I noticed if you trying to test the email order with a gift card product we have an error at this line

return $this->order->getIsVirtual()
? ''
: (string)$this->addressRenderer->format($this->order->getShippingAddress(), 'html');

in vendor/yireo/magento2-emailtester2/Model/Mailer/Variable/OrderVars.php

@jissereitsma
Copy link
Contributor

Thanks. What is the exact error?

@apomili
Copy link
Author

apomili commented Nov 8, 2022

1 exception(s):
Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Yireo\EmailTester2\Block\Adminhtml\Preview, Argument 1 passed to Magento\Sales\Model\Order\Address\Renderer::format() must be an instance of Magento\Sales\Model\Order\Address, null given, called in /var/www/html/vendor/yireo/magento2-emailtester2/Model/Mailer/Variable/OrderVars.php on line 83

I suppose because there are no addresses since is a digital giftcard

@jissereitsma
Copy link
Contributor

Got it. Until now the order was only seen as virtual when the order was indeed virtual. Perhaps you picked one order that was not virtual, while adding the giftcard to it? Anyway, I assume you know that this behaviour is something I didn't test for yet, because out of the box there is no thing like giftcards. Version 1.6.25 adds a fix though to recalculate the isVirtual flag. Let me know if this works for you too.

@apomili
Copy link
Author

apomili commented Nov 8, 2022

Ok, now I see, I didn't remember the Magento Commerce don't have the giftcard, in the last years we worked with the EE version.

Thanks for the update, I will test it as soon as possible :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants