yireo-magento1 / Yireo_GoogleTagManager

Implement Google Tag Manager in Magento 1 (deprecated)
Open Software License 3.0
56 stars 46 forks source link

Make sure order is only tracked once #111

Closed sprankhub closed 4 years ago

sprankhub commented 4 years ago

The last order ID, which is set on the checkout session, is never cleared. Hence, Mage::getSingleton('checkout/session')->getLastRealOrderId() always returns the last real order ID if the user ordered in his current session. Hence, we track the order again and again if the user keeps visiting other pages after checkout success.

This PR makes sure that the order is only tracked on the checkout success page.