motion2082 Posted May 29, 2017 Share Posted May 29, 2017 Hi guys, What is the best way to add Javascript code to 1) the ‘thank you’ page that follows or completes a purchase.2) the ‘thank you’ page that follows or completes an account creation3) the ‘thank you’ page that follows or completes a Contact Us submission Regards, Motion Link to comment Share on other sites More sharing options...
BalzoT Posted May 29, 2017 Share Posted May 29, 2017 Hi Motion, 2 efficient of ways I can think of are. 1st use the addJS functinon in setMedia of each controller you use on the specific pages 2nd on header.tpl add the script tag using a smarty if checking the page name eg. {if $page_name == 'order-confirmation' || $page_name == ... }<script src='...'></script>{/if} Link to comment Share on other sites More sharing options...
motion2082 Posted May 29, 2017 Author Share Posted May 29, 2017 Hi BalzoT That sounds like a good idea. Would using the IF statement on the header.tpl be enough? Link to comment Share on other sites More sharing options...
BalzoT Posted May 29, 2017 Share Posted May 29, 2017 It usually is, but be sure for the page names to be correct. You can see them on the body tag on the id section of the tag Link to comment Share on other sites More sharing options...
motion2082 Posted May 29, 2017 Author Share Posted May 29, 2017 No worries, thanks for that. Will see if I can figure out what the page names are for each Link to comment Share on other sites More sharing options...
Danigar Posted May 17, 2021 Share Posted May 17, 2021 The 2nd method is ok, except you have to write $page.page_name and not $page_name . 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