anmihe Posted June 1, 2014 Share Posted June 1, 2014 Hi guys, Just upgraded from 1.6.0.5 to 1.6.0.6 and now I've having some weird javascript problems It's in tools.js and ajax-cart.js and only present on the product page. When trying to change currency or add to the cart I get this error: ReferenceError: baseDir is not defined And as said, only happens on product pages, changing currency works fine on all other pages. I know baseDir is defined in header.tpl but I have change nothing there, and when comparing what script are being called and in what order its the same as before the upgrade. This is weird and really annoying. Anyone with any ideas? Thanks in advance! A Link to comment Share on other sites More sharing options...
anmihe Posted June 1, 2014 Author Share Posted June 1, 2014 Actually... baseUri in ajax-cart.js and baseDir in tools.js Link to comment Share on other sites More sharing options...
anmihe Posted June 1, 2014 Author Share Posted June 1, 2014 ...and manually declaring these in the .js files makes the currency change work but when trying to add or delete from the cart I get another error instead: static_token is not defined. Which is the next js variable to be declared in header.tpl And again, this is only for the product page, as I can remove stuff from the cart from other pages without any problem. So appears that none of the js variables getting declared in header.tpl works when on a product page. Anyone with any clues? 1 Link to comment Share on other sites More sharing options...
rboyart Posted August 12, 2014 Share Posted August 12, 2014 I have the same problem, Uncaught ReferenceError: baseUri is not defined ajax-cart.js:30 Uncaught ReferenceError: baseDir is not defined But only in product page how did you fix it? Link to comment Share on other sites More sharing options...
musicmaster Posted January 8, 2015 Share Posted January 8, 2015 (edited) I am having the same error since I added some Javascript in the middle of my page. The error comes from the ajax-cart.js file. Interestingly the error happens only on my server. On my localhost things work ok. If you look in the sourcecode of the page you find that baseUri and baseDir are being defined there in the html file. I am puzzled why it is not recognized? Has the order of reading of the scripts changed or isn't it read at all? The error is on my page: http://www.opusfinder.com/prestashop/beautifloor-laghi-klik-vinyl/9-como.html I am using PS 1.6.0.9. [solved] my problem was solved. In the end it was html related. There was some problem with the html that caused the right column to be displayed at the bottom of the page. Somehow this also caused a javascript error. Edited January 9, 2015 by musicmaster (see edit history) Link to comment Share on other sites More sharing options...
renatototo Posted April 16, 2018 Share Posted April 16, 2018 Old thread, but fresh solution for me. I had this error in my cart ( Minus / Plus/ delete buttons) were not updating the quantities. It was because I removed the 'footer' by commenting everything in the "themes\default-bootstrap\footer.tpl" file. But, at the end of this file there is an include of the global.tpl file ==> {include file="$tpl_dir./global.tpl"} And the baseUSri (for JS) is defined in this file. Moving the end of the comment " *} " just before the include line solved my issue. Hope this helps. 2 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