Sebazzianos Posted March 25, 2010 Share Posted March 25, 2010 Hello,I'm looking for a solution that it's possible to send the pdf invoice by email in the backoffice.The nicest way will be when I change the order state to (for example) send invoice an automatic email will be sent with attached the pdf invoice.Does anyone know a solution?Thanks! Link to comment Share on other sites More sharing options...
tpsvca Posted June 22, 2010 Share Posted June 22, 2010 Try to modify clacc paymentmodule.php and comment the lines:350,351,355,356,357.Or simply change this code: if (intval(Configuration::get('PS_INVOICE')) AND Validate::isLoadedObject($orderStatus) AND $orderStatus->invoice AND $order->invoice_number) { $fileAttachment['content'] = PDF::invoice($order, 'S'); $fileAttachment['name'] = Configuration::get('PS_INVOICE_PREFIX', intval($order->id_lang)).sprintf('d', $order->invoice_number).'.pdf'; $fileAttachment['mime'] = 'application/pdf'; } else $fileAttachment = NULL; By this one //if (intval(Configuration::get('PS_INVOICE')) AND Validate::isLoadedObject($orderStatus) AND $orderStatus->invoice AND $order->invoice_number) //{ $fileAttachment['content'] = PDF::invoice($order, 'S'); $fileAttachment['name'] = Configuration::get('PS_INVOICE_PREFIX', intval($order->id_lang)).sprintf('d', $order->invoice_number).'.pdf'; $fileAttachment['mime'] = 'application/pdf'; //} //else // $fileAttachment = NULL; Link to comment Share on other sites More sharing options...
Stefand Posted November 1, 2010 Share Posted November 1, 2010 this works, but how can I change the PDF filename who send by the e-mail ?I use this code above for sending the PDF into the order confirmation mail.My filename in the mail what I get right now: NLd.pdfI like to get the order number instead. Link to comment Share on other sites More sharing options...
noesac Posted November 1, 2010 Share Posted November 1, 2010 Hey this is a pretty cool idea Link to comment Share on other sites More sharing options...
shokinro Posted November 2, 2010 Share Posted November 2, 2010 I think the code posted above there is an mistake, Please change following 'd' to '%d'sprintf('%d', $order->invoice_number)After change, you file name will become something like NL12345.pdf, where NL is the prefix you define at your office(Orders - Invoices), and 12345 is the invoice no. Link to comment Share on other sites More sharing options...
Stefand Posted November 2, 2010 Share Posted November 2, 2010 I have try that, with no result. Link to comment Share on other sites More sharing options...
olea Posted November 2, 2010 Share Posted November 2, 2010 For information, a report I have raised on the subkect :http://www.prestashop.com/bug_tracker/view/5760/ Link to comment Share on other sites More sharing options...
noesac Posted November 7, 2010 Share Posted November 7, 2010 So this works, just that the name of the PDF file won't be set as the order number? Link to comment Share on other sites More sharing options...
Stefand Posted November 7, 2010 Share Posted November 7, 2010 @noasac.When you change this: $order->invoice_number).'.pdf'; to: $order->id).'.pdf'; It will display the order number in the filename. But I like to display the invoice number, but that's not working! Link to comment Share on other sites More sharing options...
Stefand Posted November 25, 2010 Share Posted November 25, 2010 Can someone explain, when I open the attachment in the order_config mail doesn't display the date and invoice number on the pdf invoice???It says: 0000000 Link to comment Share on other sites More sharing options...
nzrobert Posted February 28, 2011 Share Posted February 28, 2011 I get this -> Invalid order or invalid order state Link to comment Share on other sites More sharing options...
petermorton Posted May 24, 2011 Share Posted May 24, 2011 Can I add another email address to this? i.e. when the customer receives his email with invoice attached my warehouse also receives an email with invoice attached. They just print out the invoice and send with the goods. Any ideas? Link to comment Share on other sites More sharing options...
Barmunk Posted June 26, 2012 Share Posted June 26, 2012 I get this -> Invalid order or invalid order state me too. Link to comment Share on other sites More sharing options...
jeyjoo Posted March 15, 2014 Share Posted March 15, 2014 Hi all. Any update on this for Prestashop 1.5x? Is it possible to automatically send an invoice once payment is confirmed? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts