Jump to content

How to debug actionHoks and make sur its working


Hassene kh

Recommended Posts

Hi , 

I had registered an actionhook "actionValidateOrder" with  "registerHook('actionValidateOrder')" and in the function i tried to check if params shows me the variables that i need   

public function hookActionValidateOrder($params){

print_r($params);die();

}

and the console in chrome don't show me anything when I confirm the command after payment step . 

how to do that and make sur its working 

 

Link to comment
Share on other sites

Hi 

you can follow below steps to debug that 

1) verify hook was Registered properly from back office in Design > Positions tab 

when you search the hook you registered by checking display non positionable hooks, it will show your module in list and order too 

see screenshot 1

2) Rather than making die make a log and see that data, the data at hook contains 

cart ,order ,customer , currency and status data 

as in screenshot 2

3) enable debug mode

7E8CDF04-7A76-469B-BA7C-C9690F142119.jpeg

15CFC061-FA73-4989-B271-C30627323417.jpeg

Link to comment
Share on other sites

Hi ,

for step 1: my module is hooked in the header now how to change its position because I just displayhook in the tanspalnt module this is the list of my hooks that I need

if (

! parent :: install () ||

! $ this-> registerHook ('actionFrontControllerSetMedia') ||

! $ this-> registerHook ('hookHeader') || // used to link  js and  css in header

! $ this-> registerHook ('actionValidateOrder') ||

! Configuration :: updateValue ('NS_MONMODULE_PAGENAME', 'Mentions légales')

)

 

I also need to reinstall the module to see the changes of the hooks?

Edited by Hassene kh (see edit history)
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...