electronicshed Posted February 23, 2011 Share Posted February 23, 2011 Hi There,I've been trying to get this working for a few days now without success.Here's my code, Am I going about this the correct way? I was thinking the pdf object would be passed into the module and therefore I could add to it and return it when finished.I tried adding the pdf line directly into the PDF.php class to make sure the image worked, it did. But when I do this from my module it doesn't work, I've checked the hook is active for my module. public function hookPDFInvoice($pdf, $orderID) { $pdf->Image('[mywebsite]/prestashop/img/logo.jpg', 0, 10 , 0, 30); return $pdf; } Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Radu Posted February 23, 2011 Share Posted February 23, 2011 when you install the module, do you register the hook? Link to comment Share on other sites More sharing options...
electronicshed Posted February 23, 2011 Author Share Posted February 23, 2011 Yeah the hook is registered in the modules install function. I double checked this by manually trying to transplant the module and got the message that the module was already hooked. Link to comment Share on other sites More sharing options...
Burhan BVK Posted February 23, 2011 Share Posted February 23, 2011 Your function declaration is wrong. It should take one parameter, which is an array of parameters. public function hookPDFInvoice($params) { $params['pdf']->Image('[mywebsite]/prestashop/img/logo.jpg', 0, 10 , 0, 30); return $pdf; } Link to comment Share on other sites More sharing options...
electronicshed Posted February 23, 2011 Author Share Posted February 23, 2011 Thank-you so much! That works great! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now