CVM / Magento_GoogleTagManager

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

Error when having an order with only downloadable products #26

Open royduin opened 9 years ago

royduin commented 9 years ago

This line causes errors when I have an order with only downloadable products because there in that case there is no shipping method: https://github.com/CVM/Magento_GoogleTagManager/blob/master/app/code/community/CVM/GoogleTagManager/Block/Gtm.php#L92

I've fixed this now with:

'transactionShippingMethod' => $order->canShip() ? $order->getShippingCarrier()->getCarrierCode() : 'downloadable',

Can you fix this in the next version?

T0MM0R commented 8 years ago

I also ran into this issue. I fixed it with $order->getIsVirtual() I like your way too though! Thanks.