Jump to content

MyModule use Controller or Override to get variables from order in confirmation hook


Recommended Posts

Hello guys,

 

I have been working on making custom modules to convert manual edits to the core so they are done properly on a few sites of mine and I have been able to make my first modules and have them work fine.  I have also been able to make overrides to do similar functionality in the past, but I wanted to transfer it properly into module form and I wasn't sure if their is a way.

 

In the past I had used a override for OrderConfirmationController to add a few variables with order and product information to the order-confirmation.tpl and it works fine, but I have been told the proper way was to do this in a module using hooks.   Well now I am at the point where I have my module setup using the displayorderconfirmation hook and it is working and firing my test hook code, so my question is now what is the proper way to get the variables from the order being places over to my module for use in my hook code.  Do I still have to override OrderConfirmationController to have variables with order info such as total price, products ordered, and customer address, or can my module now use its own controller to do this in some way?   I have been reading the PS docs and example modules, and that has got me this far, but not sure what is the proper recommended way to proceed at this point.

 

Appreciate any suggestions, thanks!

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