jpietrangelo Posted December 31, 2011 Share Posted December 31, 2011 I like to work with the latest versions of jQuery and jQuery plug-ins. But if I update jQuery in PS's root/js/jQuery directory and give it the new filename with the new version number, then $js_files no longer loads it into the template head section. If I leave it named the same as the version that came installed with PS (using v.1.4.6.2) then it works (obviously.) So, all I'm trying to figure out (and I've looked everywhere) is in which file the variable, $js_files, is defined and/or initialized. Any help would be appreciated. Thanks. Jim Link to comment Share on other sites More sharing options...
btc.dev Posted January 4, 2012 Share Posted January 4, 2012 Hi, Javascript sources are added to the $js_files array via the Tools::addJS function. The jQuery version installed with PS is added in the setMedia function: public function setMedia() { global $cookie; Tools::addCSS(_THEME_CSS_DIR_.'global.css', 'all'); Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery-1.4.4.min.js', _PS_JS_DIR_.'jquery/jquery.easing.1.3.js', _PS_JS_DIR_.'tools.js')); if (Tools::isSubmit('live_edit') AND Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))) { Tools::addJS(array( _PS_JS_DIR_.'jquery/jquery-ui-1.8.10.custom.min.js', _PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js', _PS_JS_DIR_.'hookLiveEdit.js') ); Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css'); } $language = new Language($cookie->id_lang); if ($language->is_rtl) Tools::addCSS(_THEME_CSS_DIR_.'rtl.css'); } Regards, btc.dev 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