Jump to content

Remove Bxslider from source (frontend)


Guest

Recommended Posts

Hello, I'm working from the default theme, Prestashop 1.6.

Been checking docs and forum searches but I can't find ho to manage the jquery like for example bx slider:

 

<script type="text/javascript" src="/prestashop/js/jquery/plugins/bxslider/jquery.bxslider.js"></script>

 

This is what I would like to see removed. Did I miss a section in the docs how this is done? I could just remove it from the folder but then I'm not sure, maybe some of these are used in backend, too.

 

Thanks for your input.

Link to comment
Share on other sites

  • 4 months later...

I've been looking answer for the same issue... and I came up with the idea.

 

1. Create override file for Controller.php in override/classes/controller/

2. You have to modify addJqueryPlugin function, for example:

public function addJqueryPlugin($name, $folder = null, $css = true)
{
	if (!is_array($name))
			$name = array($name);

	if (is_array($name))
	{
		foreach ($name as $plugin)
		{
			if($plugin != 'bxslider')
			{
				$plugin_path = Media::getJqueryPluginPath($plugin, $folder);

				if (!empty($plugin_path['js']))
					$this->addJS($plugin_path['js'], false);
				if ($css && !empty($plugin_path['css']))
					$this->addCSS(key($plugin_path['css']), 'all', null, false);
			}
		}
	}
}

3. As you can see, I added after foreach: "if($plugin != 'bxslider')"  and checked if module name isn't bxslider.

  • Like 2
Link to comment
Share on other sites

  • 5 months later...

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