Jump to content

Edit History

EvaF

EvaF

I do not know where (at which page - my-account, or identity or..) do you want to load your javascript file.
to be true, when I am reading list of your hooks, I would do it by simply way: ( there are certainly more ellegant way)

in hookActionCustomerAccountUpdate i would set the cookie value f.e.
 

        $this->context->cookie->customer_account_update = true;

and in hookHeader I would check if cookie "customer_account_update" is set

if (isset($this->context->cookie->customer_account_update)){
  $this->context->controller->registerJavascript(
     'my-module',
     'modules/' . $this->name . '/views/js/my-module.js',
      array(
        'position' => 'bottom',
        'priority' => 2
	  )
   );
   unset($this->context->cookie->customer_account_update);
}

P.S. I wrote it blindly - didn't test it

EvaF

EvaF

I do not know where (at which page - my-account, or identity or..) do you want to load your javascript file.
to be true, when I am reading list of your hooks, I would do it by simply way: ( there are certainly more ellegant way)

in hookActionCustomerAccountUpdate i would set the cookie value f.e.
 

        $this->context->cookie->customer_account_update = true;

and in hookHeader I would check if cookie "customer_account_update" is set

if (isset($this->context->cookie->customer_account_update)){
  $this->context->controller->registerJavascript(
     'my-module',
     'modules/' . $this->name . '/views/js/my-module.js',
      array(
        'position' => 'bottom',
        'priority' => 2
	  )
   );
   unset($this->context->cookie->customer_account_update);
}

 

×
×
  • Create New...