Nosto/nosto-jtlshop-module — pull request #4 by mridang (2014-07-28 09:37:19+00:00)
Title: Fix the order-confirmation page when Paypal is used to pay

The order-confirmaton page when paying with Paypal doesn't work as expected. The order-confirmation page is encountered before the visitor goes to Paypal. When the page loads, and the `DOMReady` event fires, the Paypal plugin redirects the user to Paypal.

Even though we have the Nosto script on the page, we don't always get the order-tagging and our system thinks of the user as a visitor with an abandoned cart.

Since out script loads in a frame, the `DOMReady` event doesn't wait for the script as it a separate frame. In order to resolve this, the Nosto script is added to the body, right after all the tagging. This only happens for the order-confirmation page, the rest of the pages work normally.

This method will always cause our script to be loaded before the `DOMReady` and we get the order-tagging.