gmz-collection Posted October 10, 2014 Share Posted October 10, 2014 I've been having an issue with a custom order hook that generates some Javascript. Part of my code is being output, but the rest mysteriously gets combined with some other Javascript on the page. I've disabled all CCC and caching, but still some "optimization" seems to take place. I have verified that the code is being correctly generated, by directly echo'ing it back to the browser. Once I inspect the page's source (Chrome), part of the generated code is missing. Inspecting the DOM tree shows that part of the script contents have been moved elsewhere (into GA-tracking to be specific). I feel like I've exhausted all possibilities, so any insights would be greatly appreciated. Link to comment Share on other sites More sharing options...
El Patron Posted October 10, 2014 Share Posted October 10, 2014 good point statictic, original poster, more information is required. provide detail you think you would yourself need to solve. include what native PrestaShop function you are using to add your JavaScript, and if you have hook header in module. as an example. Link to comment Share on other sites More sharing options...
gmz-collection Posted October 11, 2014 Author Share Posted October 11, 2014 I'm sorry, I had to strip down my original post a bit, because I was having a very hard time getting my post to even submit to the forum. Seems like the spam filter was a little trigger happy. There is probably a better way to get this done, but I chose to add a hook to controllers/front/OrderConfirmationController.php: http://pastebin.com/RFfKU5as And then refer to it in the template file themes/simplio/order-confirmation.tpl: http://pastebin.com/pWEMMqf4 On completing an order, all code within the CDATA section is mysteriously taken out and moved to another part of the document. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now