I’m trying to develop a new module but just can’t get the correct solution, I hope you can help me.
On the checkout complete page i need the order object with all information of the just created order to print out an javascript code which will be created with the order data and execute when the user completes the checkout process. With the hook “myModule_footer” I am getting into the footer to print my code and with “arg(2)” I can check if the URL is “complete”. But now I need to get the order object but I just can’t find the right way to do it.
I also tried other hooks like “myModule_checkout_complete” but they won’t work:
function myModule_checkout_complete($order, $account) { drupal_set_message('It works'); }
Is there an better solution to hook into the checkout complete page, get the order object and return some code to the frontend?
Thanks