Jump to content

[SOLVED] Uncaught ReferenceError: $ is not defined


Recommended Posts

I know this was discussed maytime, but I couldn't find any appropriate solution:

 

My back office is not loading the jquery-1.7.2.js for some reason. That means any aditional scripts will not work without the main jquery file. I open up my dev tools and I get 8 

Uncaught ReferenceError: $ is not defined 

Which is normal if the jquert-1.7.2.js is not loaded. I inspect the source of my BO and the file it's not there. 

 

I then move out to see if the file is actually there. I opened up the header.inc.php file inside my admin dir and locked at line 49. There I have this line:

<script type="text/javascript" src="'._PS_JS_DIR_.'jquery/jquery-'._PS_JQUERY_VERSION_.'.min.js"></script>

So that means in my prestashop install folder/js/jquery/ I should have a file called jquery-1.7.2..min.js. And I have it. Whey this prestashop is not loading that file. ?????

 

And also I'm running PrestaShop™ 1.5.4.1 and I cannot upgrade cause my theme is not compatible with the latest verion. Also this is a live website. 

 

The front office is working without any problems.

 

But since I cannot edit/add/ products, categories, or anything else, I really need some help on this one.

 

So please be so kind and let me know what can I do.

Link to comment
Share on other sites

ok I get this problem done. I don't know what hapend but I did mange to make my Back Office working again.

Maybe others will have the same problem as me, so I will just write down what I did.

 

1. Download a fresh copy of prestashop 1.5.4.1

2. Delete all the files and folders from my Admin directory on my server

3. Upload all the files and folders from the Admin directory from the fresh copy to Admin directory on my server

4. Delete all the files and folders from js folder on my server

5. Upload all the files and folders from js folder from the fresh copy to my js folder on my server.

 

That's it now everything works perfectly.

Link to comment
Share on other sites

classes/controllers/AdminCOntroller.php

$this->addJquery();

in controller.php you can find this function:

	public function addJquery($version = null, $folder = null, $minifier = true)
	{
		$this->addJS(Media::getJqueryPath($version, $folder, $minifier));
	}
Link to comment
Share on other sites

  • 3 years later...

When adding or editing products in our backend, the tinymce editor no longer loads and all the descriptions are displaying in html format.  I turned on error reporting and nothing comes up. We also are unable to click on the tabs on the left hand side to move through each aspect of the product, and an error sometimes displays that some tabs could not be loaded.  I am using 1.5.2 and on a hosted server.  I have added a screenshot of the backend to show what we are seeing. 


 



  1. Uncaught SyntaxError: Unexpected identifier

    products.js:1032 Uncaught ReferenceError: id_product is not defined

        at Object.bindAvailableForOrder (products.js:1032)

        at onReady (products.js:1187)

        at ProductTabsManager.onLoad (products.js:87)

        at ProductTabsManager.init (products.js:53)

        at HTMLDocument.<anonymous> (products.js:1892)

        at j (jquery-1.11.0.min.js:2)

        at Object.fireWith [as resolveWith] (jquery-1.11.0.min.js:2)

        at Function.ready (jquery-1.11.0.min.js:2)

        at HTMLDocument.K (jquery-1.11.0.min.js:2)


 

please help me out if there is any possible solution

Link to comment
Share on other sites

×
×
  • Create New...