cyril_nel Posted October 11, 2019 Share Posted October 11, 2019 Hello, i created a new class called OrderInvoiceCustom but when i try to generate the new pdf i get this error : Catchable fatal error: Argument 1 passed to HTMLTemplateInvoiceCore::__construct() must be an instance of OrderInvoice, instance of OrderInvoiceCustom given, called in /newpresta/classes/pdf/PDF.php on line 127 and defined in /newpresta/classes/pdf/HTMLTemplateInvoice.php on line 41 The code is : $oic->id_supplier = $id_supplier; $order_invoice_list = $oic->getInvoicesCollectionBySupplier($id_order,$id_supplier); $order_invoice_list2 = $order->getInvoicesCollection(); Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list)); $pdf = new PDF($order_invoice_list, 'InvoiceCustom', $context->smarty); $pdf->render(); If you get any ideas i'm really interesting. 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