CVM / Magento_GoogleTagManager

Google Tag Manager extension for Magento
67 stars 55 forks source link

Failure to retrieve transactionShippingMethod on Orders containing all-Virtual products #30

Open wpalmer opened 8 years ago

wpalmer commented 8 years ago

The transactionShippingMethod key unconditionally attempts to output the shipping "Carrier Code". This is fine in most cases, but for "virtual" orders (ie, orders for which all products are virtual, and so there is no shipping information whatsoever), no CarrierCode is defined. This results in an illegal offset error (internal to Magento) when the non-existent carrier information is requested.

The pull request https://github.com/CVM/Magento_GoogleTagManager/pull/29 attempts to correct this issue, using similar logic to that found within the checkout controllers. ie: only referencing shipping information if the order is not Virtual.