Jump to content

baseUri is not defined after upgrade, but only on product pages


anmihe

Recommended Posts

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

...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?

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

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 by musicmaster (see edit history)
Link to comment
Share on other sites

  • 3 years later...

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.

 

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...