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

Virtual Order causes fatal error preventing display of order success page #10

Open
xantek-imc opened this issue Oct 23, 2019 · 0 comments

Comments

@xantek-imc
Copy link

xantek-imc commented Oct 23, 2019

Greetings,

Magento allows orders that do not have a shipping address (virtual orders.) These are ordered with only downloadable or e-gift cards in the order. The following code assumes a shipping address will be returned

$shippingAdd = $shippingAddress->getData();

If there is now shipping address on the order
Error: Uncaught exception 'Error' with message 'Call to a member function getData() on null' in reflektion_magento_2/view/frontend/templates/analytics/rfk_order_analytics.phtml

This causes the user to be redirected to an empty cart instead of displaying the order success page.

We've created a patch to work around the issue.

$shippingAddress = $order->getShippingAddress();
if (!$shippingAddress) {
    $shippingAddress = $order->getBillingAddress();
}
$shippingAdd = $shippingAddress->getData();
@xantek-imc xantek-imc changed the title Virtual Order case Virtual Order causes fatal error preventing display of order success page Oct 23, 2019
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

1 participant