Jump to content

Help with jQuery conflict


Recommended Posts

Hi,

 

I recently bought a module from Prestashop addons, called Facebook Module Slider.

The module itself seems great, but it does not work together with my other modules and plugins on the site.

 

I think there might be something wrong with the jQuery, causing a conflict between the new module and the other modules. The new module is placed on top and the other modules won't load when the new module has loaded.

 

The Module Slider uses the 1.4.2 jQuery from Google's library, and the other modules use their own libraries (also 1.4.2) at my own server. My Prestshop version seems to use jQuery 1.4.4.

 

I appreciate all help I can get.

 

Archie

Link to comment
Share on other sites

Thanks for the answer. But how would I do that? There are three different modules, one for the slider, one for the shopping basket and one for the new facebook integration. I would like to change the fb-module, since everything worked ok before I added this. There is no separate js-file, only a php-file. Since I am just a beginner in coding, I need some help with this.

Link to comment
Share on other sites

Thanks for the answer. But how would I do that? There are three different modules, one for the slider, one for the shopping basket and one for the new facebook integration. I would like to change the fb-module, since everything worked ok before I added this. There is no separate js-file, only a php-file. Since I am just a beginner in coding, I need some help with this.

 

Maybe there is a .tpl file? If not, search for the url to the jquery file that it includes and remove that include in the php file.

Link to comment
Share on other sites

Maybe there is a .tpl file? If not, search for the url to the jquery file that it includes and remove that include in the php file.

 

Hi,

 

The only reference I can find in the php-file is the below code. When I remove it, the module won't work. Any idea?

 

{

global $smarty;

if ($this->jquery == 1) {

$slidelikebox = '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>';

}

elseif ($this->jquery == 0) {

$slidelikebox = '&nbsp';

}

$slidelikebox .= '<script src="https://apis.google.com/js/plusone.js"></script>';

 

$slidelikebox .= '<link href="https://plus.google.com/'.$this->google_id.'" rel="publisher" /><script type="text/javascript">

window.___gcfg = {lang: "'.$this->language.'"};

(function()

{var po = document.createElement("script");

po.type = "text/javascript"; po.async = true;po.src = "https://apis.google.com/js/plusone.js";

var s = document.getElementsByTagName("script")[0];

s.parentNode.insertBefore(po, s);

})();</script>';

Link to comment
Share on other sites

Yes, that's it. It seems like the module have a setting for turning off the inclusion of jQuery. I can see that from the following rows:

 

// This is checking if jQuery inclusion is on, if it's on...
if ($this->jquery == 1) {
// include the jquery script....
$slidelikebox = '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>';
}

 

Have you checked the module settings?

Link to comment
Share on other sites

Yes, that is the strange thing. If I turn it off, I still get the error with my other modules, but then the fb module does not work at all. I got no clue why this happens.

 

Perhaps I could post the entire code, but I do not know if that is allowed, since this is a paid module?

Link to comment
Share on other sites

Perhaps I could post the entire code, but I do not know if that is allowed, since this is a paid module?

 

That's probably not a good idea. Have you tried to get any support from the ones who wrote the module? They should be eager to assist you on this.

 

Do you have a link to your site so I could take a look?

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