pitrrs Posted December 3, 2014 Share Posted December 3, 2014 (edited) Hi, i need override default PS PDF invoice generator by my own (complete). Its possible? Ideal without modifing core files (as module or override file) Thanks for replies. Edited December 3, 2014 by pitrrs (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted December 3, 2014 Share Posted December 3, 2014 Create a new file as /override/classes/pdf/PDFGenerator.php and put some method(s) inside the brackets. class PDFGenerator extends PDFGeneratorCore { } Link to comment Share on other sites More sharing options...
pitrrs Posted December 3, 2014 Author Share Posted December 3, 2014 Create a new file as /override/classes/pdf/PDFGenerator.php and put some method(s) inside the brackets. class PDFGenerator extends PDFGeneratorCore { } Hi, thanks for your reply. Okay and how in this class i get order details (customer detail, shop details(name etc.), seller detail, Products...)? Link to comment Share on other sites More sharing options...
tuk66 Posted December 3, 2014 Share Posted December 3, 2014 This is not the right place. See the original PDFGenerator.php. You have probably meant other class. What is your motivation? What do you want to do? Link to comment Share on other sites More sharing options...
pitrrs Posted December 3, 2014 Author Share Posted December 3, 2014 I need this: ignore original PDF invoice generator and use my own class for PDF invoice generation. In my invoice generator i need use get order details. I do not use HTML templating like PS. I have other solution. Link to comment Share on other sites More sharing options...
tuk66 Posted December 3, 2014 Share Posted December 3, 2014 You should rather override HTMLTemplateInvoice class. Link to comment Share on other sites More sharing options...
pitrrs Posted December 3, 2014 Author Share Posted December 3, 2014 If i create this files with var_dump(func_get_args());exit; in __construct method. It does not do anything.... Link to comment Share on other sites More sharing options...
pitrrs Posted December 4, 2014 Author Share Posted December 4, 2014 Anyone can help me? I can't find solution... Link to comment Share on other sites More sharing options...
Housy Posted October 30, 2015 Share Posted October 30, 2015 Hello guys Why am i not able to override PDFGenerator.php file? Under "Override/classes/pdf/" i have created the same file, which is PDFGenerator.php. Within that file i have put code below, because i want to define different header and footer height. The problem is, that override doesn't work at all, even if i disable cache and delete class_index.php file within cache directory. What am i doing wrong? Is there maybe a bug or something? <?php class PDFGeneratorCoreOverride extends PDFGeneratorCore { /* Header and Footer HEIGHT change */ public function writePage() { $this->SetHeaderMargin(10); $this->SetFooterMargin(30); $this->setMargins(10, 40, 10); $this->AddPage(); $this->writeHTML($this->content, true, false, true, false, ''); } } I am using Prestashop version 1.6.0.14. If i change code directly, it affects PDF, when it is exported. It works as it should but no results, when overriding PDFGenerator.php file. Overriding works good for modules as well.Could you guys take a look and help me here please?Thank you and best regards,Housy Link to comment Share on other sites More sharing options...
eleazar Posted October 31, 2015 Share Posted October 31, 2015 @housy Please avoid double posts. 1 Link to comment Share on other sites More sharing options...
Housy Posted November 3, 2015 Share Posted November 3, 2015 @housy Please avoid double posts. I apologize, i just wanted to solve this problem as fast as possible. 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