Jump to content

Edit History

feho1

feho1

Hi, following the official guide how to create module i have created my custom module and now i want to call JavaScript function or file to execute function in my module using hooks,in my from custom module from hookActionCustomerAccountUpdate or any other hook i tried but unsuccessful , I have registered the hooks and 
$this->context->controller->registerJavascript( // 'my-module', // 'modules/' . $this->name . '/views/js/my-module.js', // array( // 'position' => 'bottom', // 'priority' => 2 // ) // );

$this->context->controller->registerJavascript(
			'my-module',
				'modules/' . $this->name . '/views/js/my-module.js',
			array(
					'position' => 'bottom',
				'priority' => 2
				)
		);

and when i enter this into hookActionCustomerAccountUpdate it does not call the javascript which is alert, but in header it always calls in every page understandably.

What I have tried: 
calling header hook from hookActionCustomerAccountUpdate Hook::exec, with this->hookHeader.



My question is how do i call javascript or javascript function or Ajax on hook in module ?

feho1

feho1

Hi, following the official guide how to create module i have created my custom module and now i want to call JavaScript function or file to execute function in my module using hooks,in my from custom module from hookActionCustomerAccountUpdate or any other hook i tried but unsuccessful , I have registered the hooks and 
$this->context->controller->registerJavascript( // 'my-module', // 'modules/' . $this->name . '/views/js/my-module.js', // array( // 'position' => 'bottom', // 'priority' => 2 // ) // );

$this->context->controller->registerJavascript(
			'my-module',
				'modules/' . $this->name . '/views/js/my-module.js',
			array(
					'position' => 'bottom',
				'priority' => 2
				)
		);

and when i enter this into hookActionCustomerAccountUpdate it does not call the javascript which is alert, but in header it always calls in every page understandably.

What I have tried: 
calling header hook from hookActionCustomerAccountUpdate Hook::exec, with this->hookHeader.



My question is how do i call javascript or javascript function or Ajax on hook in module ?

feho1

feho1

Hi, following the official guide how to create module i have created my custom module and now i want to call JavaScript function or file to execute function in my module using hooks,in my from custom module from hookActionCustomerAccountUpdate or any other hook i tried but unsuccessful , I have registered the hooks and 
$this->context->controller->registerJavascript( // 'abraxas', // 'modules/' . $this->name . '/views/js/abraxas.js', // array( // 'position' => 'bottom', // 'priority' => 2 // ) // );

$this->context->controller->registerJavascript(
			'my-module',
				'modules/' . $this->name . '/views/js/my-module.js',
			array(
					'position' => 'bottom',
				'priority' => 2
				)
		);

and when i enter this into hookActionCustomerAccountUpdate it does not call the javascript which is alert, but in header it always calls in every page understandably.

What I have tried: 
calling header hook from hookActionCustomerAccountUpdate Hook::exec, with this->hookHeader.



My question is how do i call javascript or javascript function or Ajax on hook in module ?

×
×
  • Create New...