Sociallogin Posted May 26, 2012 Share Posted May 26, 2012 If I use public function hookHeader( $params ){ echo "<script>alert('hi');</script>"; } then in view source i view, <script>alert('hi');</script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> it means it's called even before html tag itself. this happens with top also. but in prestashop docs, http://doc.prestashop.com/display/PS14/Creating+a+PrestaShop+module it's written at different place. header header.php No Called between the HEAD tags. Ideal location for adding JavaScript and CSS files. top header.php Yes Called in the page's header. Link to comment Share on other sites More sharing options...
olea Posted May 27, 2012 Share Posted May 27, 2012 Your hook should do a return of the script string rather than an echo Link to comment Share on other sites More sharing options...
Sociallogin Posted May 29, 2012 Author Share Posted May 29, 2012 Thanks, I will try and i think it will work Link to comment Share on other sites More sharing options...
Recommended Posts