Skip to content

Conversation

@wpalmer
Copy link

@wpalmer wpalmer commented Nov 26, 2015

transactionShippingMethod was unconditionally attempting to output the
shipping "Carrier Code". This is fine in most cases, but for "virtual"
orders, no CarrierCode is defined, resulting in an illegal offset error
(internal to Magento) when the non-existent carrier information is
requested.

To avoid this, add a ->getIsVirtual() check on the $order, and only
request Shipping Carrier information for non-Virtual orders. This is the
same logic (though not exactly the same method) used within core Magento
code within the Checkout process, and so appears to be an expected
condition for accessing such data.

transactionShippingMethod was unconditionally attempting to output the
shipping "Carrier Code". This is fine in most cases, but for "virtual"
orders, no CarrierCode is defined, resulting in an illegal offset error
(internal to Magento) when the non-existent carrier information is
requested.

To avoid this, add a ->getIsVirtual() check on the $order, and only
request Shipping Carrier information for non-Virtual orders. This is the
same logic (though not exactly the same method) used within core Magento
code within the Checkout process, and so appears to be an expected
condition for accessing such data.
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

Successfully merging this pull request may close these issues.

1 participant