wakabayashi Posted February 13, 2017 Share Posted February 13, 2017 (edited) How can I duplicate the Generate Invoice PDF Process in Prestashop 1.6? I want to use a different tpl file, but the rest should stay the same. Let me explain, what I already did: HTMLTemplateInvoice as HTMLTemplateMahnung and changed Class Name. Added: const TEMPLATE_MAHNUNG = 'Mahnung'; to the file classes/pdf/PDF.php Created file mahnung.tpl in root/pdf folder Added to AdminPdfController.php: public function processGenerateMahnungPdf() { if (Tools::isSubmit('id_order')) { $this->generateMahnungPDFByIdOrder(Tools::getValue('id_order')); } elseif (Tools::isSubmit('id_order_invoice')) { $this->generateInvoicePDFByIdOrderInvoice(Tools::getValue('id_order_invoice')); } else { die(Tools::displayError('The order ID -- or the invoice order ID -- is missing.')); [spam-filter] AND public function generateMahnungPDFByIdOrder($id_order) { $order = new Order((int)$id_order); if (!Validate::isLoadedObject($order)) { die(Tools::displayError('The order cannot be found within your database.')); } $order_invoice_list = $order->getInvoicesCollection(); Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list)); $this->g eneratePDF($order_invoice_list, PDF::TEMPLATE_MAHNUNG); } But it's not working. It just doesn't generate the PDF. I get a blank Page... Any help? Edited February 13, 2017 by wakabayashi (see edit history) Link to comment Share on other sites More sharing options...
col_vert Posted April 2, 2019 Share Posted April 2, 2019 Hey wakabayashi, Did you find out the solution ? i want to do the same but i am stuck as well ! When you say : " HTMLTemplateInvoice as HTMLTemplateMahnung and changed Class Name." what is the name of the class then in your new file ? Thks Link to comment Share on other sites More sharing options...
wakabayashi Posted April 2, 2019 Author Share Posted April 2, 2019 Yeah I found a solution, but I don't remember it. I don't use the classical prestashop anymore. 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