Jump to content

Jquery-ui in FrontController with prestashop 1.6


flobrflo

Recommended Posts

Hi i would like to use a script using jquery-ui lib on FrontController.

 

I download the script so don't know which part of the lib use, so i would like to know how import jquery-ui.

 

i try:

$this->context->controller->addJS('http://code.jquery.com/ui/1.10.4/jquery-ui.min.js');
//or v3 or v2...

but i got the error:


Error: cannot call methods on autocomplete prior to initialization; attempted to call method 'http://mydomain.com/index.php?controller=search

if i remove jquery-ui, error desappear, and if i had jquery-ui on other front page error appear.

But don't have the error on admin.

(maybe cause the blocksearch is only on Front? xD)

 

Any idea? =)

Link to comment
Share on other sites

  • 2 years later...

Here's what got jquery at least into the header when I have this in my module code


public function hookHeader()
{
	
	$this->context->controller->addJqueryUI('ui.core');
	$this->context->controller->addJqueryUI('ui.widget');
	$this->context->controller->addJqueryUI('ui.mouse');
	$this->context->controller->addJqueryUI('ui.slider');
	$this->context->controller->addJS($this->_path.'/js/front.js');
	$this->context->controller->addCSS($this->_path.'/css/front.css');
}

But it's still not working

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